I would like to be able to program my board (STM32F407G Discovery) and use the serial monitor from the arduino ide. I’m a windows user.
These are the steps I’ve taken to try to acheive this;
1) I have made a completely fresh install of the IDE 1.8.6. (no files in appdata or documents)
2) Updated the firmware STSW-LINK007 and installed the usb driver STSW-LINK009 from here: https://www.st.com/en/evaluation-tools/ … overy.html
3) Added the STM core following the instructions here: https://github.com/stm32duino/wiki/wiki/Getting-Started
4) Plugged my board in and watched both the com port and usb driver install without issue.
5) Opened the arduino IDE, selected Discovery from the board manager and then STM32F407G-DISC1
6) Chosen ST-Link as the upload method
7) Used the serial option “Enabled with generic serial”
8) COM1 is the only available port, so left this selected
9) Opened and uploaded “Blink”. An LED flashes on the board as expected.
10) Modified blink as follows;
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Blink
*/
// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(9600);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
Serial.println("Wax on");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
Serial.println("Wax off");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
[pareidolialjebus – Sat Sep 08, 2018 8:51 am] –
8) COM1 is the only available port, so left this selected
COM1 is not the right COM port for your board. How about the device manager in windows? Any question marks?
I believe, there went something wrong with the installation under windows on your board. (I don’t really know which drivers are needed, sorry)
Did you get the board working with other serial port example rather than STM32duino?
What’s your output on your Arduino IDE? Any errors? Successful upload message?
[madias – Sat Sep 08, 2018 10:47 am] –[pareidolialjebus – Sat Sep 08, 2018 8:51 am] –
8) COM1 is the only available port, so left this selectedCOM1 is not the right COM port for your board. How about the device manager in windows? Any question marks?
I believe, there went something wrong with the installation under windows on your board. (I don’t really know which drivers are needed, sorry)
Did you get the board working with other serial port example rather than STM32duino?
What’s your output on your Arduino IDE? Any errors? Successful upload message?
Taking a look in device manager and expanding everything, I see no question marks in any area.
I took a screenshot for you;

I’ve tried the generic core too, but this had the same issue. I wondered if it was some kind of conflict – this is why I removed everything and started from a fresh install before posting.
I’ve not had this board working with anything else at all and wouldnt know where to begin. I’ve installed a few other IDE’s in the past and left completely baffled.
The output from the sketch above is as follows – I dont see any errors and I get a blinky light;
Sketch uses 18968 bytes (1%) of program storage space. Maximum is 1048576 bytes.
Global variables use 1272 bytes (0%) of dynamic memory, leaving 195336 bytes for local variables. Maximum is 196608 bytes.
STM32 ST-LINK CLI v3.0.0.0
STM32 ST-LINK Command Line Interface
ST-LINK SN : 49FF6B064965525430261387
ST-LINK Firmware version : V2J31S0
Connected via SWD.
SWD Frequency = 4000K.
Target voltage = 2.9 V.
Connection mode : Normal.
Device ID:0x411
Device flash Size : 1024 Kbytes
Device family :STM32F40xx/F41xx
Loading file...
Flash Programming:
File : C:\Users\Pare\AppData\Local\Temp\arduino_build_949794\Blink.ino.bin
Address : 0x08000000
Memory programming...
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
0%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 100%
Memory programmed in 0s and 843ms.
Programming Complete.
MCU Reset.
run application to exit
Application started.
Either on generic core or STMcore, there is no option for me “Enabled with generic serial” for the STM32F407G Discovery
on generic there is only “Serial (Virtual COM port”
on STMcore (maybe my one is outdated) there is nothing, because there is no USB serial on this core yet.
So which core do you use at the moment?
For generic core did you downloaded it here? https://github.com/danieleff/STM32GENERIC
It requires connections for ST-LINK VCP on U2 pin 12 and 13.
See UM1472 §6.1.3 ST-LINK/V2-A VCP configuration:
https://www.st.com/content/ccc/resource … 039084.pdf
It is a Discovery board. I’m not familiar with the menu tree for these devices, but it appears to me to be a USB enumeration issue. Frédéric will chime in or one of the STM Official board users.
Ray
[fpiSTM – Sat Sep 08, 2018 12:36 pm] –
By default, the STLink VCP is not connected by default to USART3 (PA3/PA2) of the F407 on this board.
It requires connections for ST-LINK VCP on U2 pin 12 and 13.
See UM1472 §6.1.3 ST-LINK/V2-A VCP configuration:
https://www.st.com/content/ccc/resource … 039084.pdf
Thanks – having had a read it looks pretty sure to be the issue. I’m going to try to solder some jumper wires and not make a mess of it. If it all goes horribly wrong I’ll buy a new board that doesnt have the issue.
Wish me luck! I’ll post a pic and give the results either way.
To me the op should use an external usb to serial adapter..
Ok, the STM32F407G-DISC1 has st-link v2-A which has vcp…
Ps: you sure you don’t have the old STM32F4DISCOVERY version? Because that one does not have VCP..
Tips: If you have a nucleo you can use the STLink Rx/TX (CN3) to connect to the PA3/PA2 and remove CN2 Jumper to isolate the STLink part from the Nucleo MCU. This is what I made and this is really useful when you do not have a FTDI.
[fpiSTM – Sat Sep 08, 2018 1:35 pm] –
Tips: If you have a nucleo you can use the STLink Rx/TX (CN3) to connect to the PA3/PA2 and remove CN2 Jumper to isolate the STLink part from the Nucleo MCU. This is what I made and this is really useful when you do not have a FTDI.
Everybody should by at least one cheap Nucleo board with STLink 2.1 because OF the STLink 2.1 – there is no cheaper official option to get one. ![]()


It looks like there’s a bridge but there isnt, tested with a multimeter, ugly, but functionally what is needed.
It still doesn’t work however. I’m not sure how old the old version is, what I can say is it’s been sat in my spares boxes for probably 5 years. Dug it out when I found this forum. Was hoping to find a use for it.
[edogaldo – Sat Sep 08, 2018 1:32 pm] –
Ps: you sure you don’t have the old STM32F4DISCOVERY version? Because that one does not have VCP..
Else you can try to update the STLink firmware version also.
[fpiSTM – Sat Sep 08, 2018 4:51 pm] –
Edolgado point this:[edogaldo – Sat Sep 08, 2018 1:32 pm] –
Ps: you sure you don’t have the old STM32F4DISCOVERY version? Because that one does not have VCP..Else you can try to update the STLink firmware version also.
Step 2 in the old post. Running the latest version of both the firmware and usb drivers.
I managed to kill the board completely trying to revisit the soldering to get rid of the lump of solder that was almost touching another leg – I was wondering if there was some capacitance maybe (although if i’d have considered it more really this would perhaps have given garbled results in the monitor or just missed out characters). Anyway I touched the solder, it immediately wicked between the legs and that was it, tried to clear it with a scalpel and lifted a leg. It’s in the bin now.
What’s the easiest of these boards to get on with that the arduino serial monitor works with out of the box?
[pareidolialjebus – Sat Sep 08, 2018 9:03 pm] –
I just wanted to say a big thanks to everyone that tried to help.I managed to kill the board completely trying to revisit the soldering to get rid of the lump of solder that was almost touching another leg – I was wondering if there was some capacitance maybe (although if i’d have considered it more really this would perhaps have given garbled results in the monitor or just missed out characters). Anyway I touched the solder, it immediately wicked between the legs and that was it, tried to clear it with a scalpel and lifted a leg. It’s in the bin now.
What’s the easiest of these boards to get on with that the arduino serial monitor works with out of the box?
Regrets on killing the board… but, it may have been static-damaged from being in the parts bin over the years. A moment of silence in respect for the board that died far too early… raise a glass to salute what might have been. (As Roger inferred, some solder wick and a bit of steady hand may revive the board.)
On a more serious note, I suspect Frederic will chime in on a more approrpiate Discovery board. I’m not familiar with the current offerings.
Your experience is not anything that has not happened to the majority (may all) of our members that have made hardware changes to the development boards. The most common thing is too much heat which will cause the narrow copper cladding to simply come off the board material. Hot air and solder wick or those new temperature controlled tiny-tip soldering irons are a worthy investment in this hobby.
Ray
[mrburnette – Sat Sep 08, 2018 11:33 pm] –
Regrets on killing the board… but, it may have been static-damaged from being in the parts bin over the years. A moment of silence in respect for the board that died far too early… raise a glass to salute what might have been. (As Roger inferred, some solder wick and a bit of steady hand may revive the board.)On a more serious note, I suspect Frederic will chime in on a more approrpiate Discovery board. I’m not familiar with the current offerings.
Your experience is not anything that has not happened to the majority (may all) of our members that have made hardware changes to the development boards. The most common thing is too much heat which will cause the narrow copper cladding to simply come off the board material. Hot air and solder wick or those new temperature controlled tiny-tip soldering irons are a worthy investment in this hobby.
Ray
It’s ok, it’s properly dead. The leg that lifted off the board ended up attached to the wire but not the chip.
I’m definately interested in taking my midi project off the arduino mega it currently lives on and putting it on something a bit faster, perhaps with a touch screen. There are so many boards! This is a good thing of couse, I’m just not sure where to go next. Nucleo perhaps (if the serial monitor works without too much hassle).
A wise decision is to buy not only one board, but at least 3 (a blue pill costs about 1.6 EUR a maple mini 3 EUR), but don’t forget to buy a ST-Link Clone (~2 EUR) if you are going with the BP (maple mini has a USB bootloader “onboard” with a BP you need to flash the bootloader or program it directly with the ST-Link which is more comfortable if you use USB-MIDI (I can explain this further if you are ready)).
For example, this was only done with a maple mini and a ILI9341 touch screen:
https://www.youtube.com/watch?v=-jvCRHCk7wQ
(keep in mind, I used a very old MIDI-USB library which is now part of the USB-composite lib)
For Serial MIDI only this library *should* be compatible with all cores and boards:
https://github.com/FortySevenEffects/ar … di_library
[madias – Sun Sep 09, 2018 12:32 am] –
If you are going to use MIDI (serial + USB) maybe the best starting board would be a blue pill or maple mini (please refer to the stm32 wiki) and using Rogers core. There are many examples for MIDI in this forum and all belong to Rogers core which is the only one who supports USB-MIDI out of the box.
…
I think that if the Op is into immediate gratification, then libmaple is an option, but STM Official core has made great strides in a year and I believe it is the future of STM32-on-Arduino.
Were I to advise the Op, I would develop on: https://github.com/stm32duino/Arduino_Core_STM32 and select from the large supported list of Nucleo/Discovery boards.
Porting from AVR to STM32, I think the Op’s efforts and learning should be time-proof …only the STM Official core provides this umbrella policy… plus Frédéric Pillon and his team need high volume feedback to STM to show the value in the Arduino investment… these efforts are expensive.
Ray
[mrburnette – Sun Sep 09, 2018 2:48 pm] –
plus Frédéric Pillon and his team need high volume feedback to STM to show the value in the Arduino investment… these efforts are expensive.
his team is a big term
Anyway, you are right… I’m currently monitor requests and made some graphics to show activities to my management.
As I already mentioned, I’m currently working on continuous integration (CI) process, automatic build are now up and running (Travis on Github and more advanced one internally).
Now, I deploy internally an automatic tests bench (on several boards/MCU series) to avoid regressions, this will be a good achievement to help in the development/maintenance and speed up PR review and release ![]()
[mrburnette – Sun Sep 09, 2018 2:48 pm] –
Were I to advise the Op, I would develop on: https://github.com/stm32duino/Arduino_Core_STM32 and select from the large supported list of Nucleo/Discovery boards.
I’m quite happy to stick with this core, but I do need to find another board. And perhaps a dedicated hardware serial device i can use to monitor that kind of data so i never have to ruin another board again with my clumsy attempts at soldering.
I took a look at blue pill boards. They seem to have a number of issues before you even plug them in, requiring changes to a resistor and perhaps the voltage regulator.
[pareidolialjebus – Sun Sep 09, 2018 9:56 pm] –
…
I’m quite happy to stick with this core, but I do need to find another board. And perhaps a dedicated hardware serial device i can use to monitor that kind of data so i never have to ruin another board again with my clumsy attempts at soldering.I took a look at blue pill boards. They seem to have a number of issues before you even plug them in, requiring changes to a resistor and perhaps the voltage regulator.
“Pills”, be they black, blue, or red are cheap-ass boards subject to no QA. They are also 2-sided with no ground-plane, so analog signals can be affected by digital noise. But what does one expect for around $2?
I would make a must-have wish list and run it by the specifications, or Frédéric https://github.com/fpistm
The community, as a whole, is too diverse (and too cheap) to provide you with a targeted recommendation, IMHO
Ray
https://www.aliexpress.com/item/STM32F1 … 56794.html
Pros for beginners:
- Corrected resistors
- bootloader already flashed (as a buyer option) – so there is no need for a ST-Link V2 (but I strongly recommend buying at least one)
- everything soldered (as a buyer option)
This board is also on the Wiki: https://wiki.stm32duino.com/index.php?t … Black_Pill
BTW: Robotdyn has a very good reputation in this forum.
[edogaldo – Mon Sep 10, 2018 9:53 am] –
To me the most valuable board would be the Nucleo-L476RG that you can find on ebay for about 20 bucks: https://www.ebay.com/itm/1PCS-NUCLEO-L4 … 2247257719
This board *could* be superb, but one thing is missing: An USB connector directly to the L476 (ok, you can solder it with 2 resistors and a jack, but I really don’t understand the lack of this feature). @mouser you can grab it for 12.38 EUR (free shipping for orders > 50 EUR)
[madias – Mon Sep 10, 2018 10:43 am] –[edogaldo – Mon Sep 10, 2018 9:53 am] –
To me the most valuable board would be the Nucleo-L476RG that you can find on ebay for about 20 bucks: https://www.ebay.com/itm/1PCS-NUCLEO-L4 … 2247257719This board *could* be superb, but one thing is missing: An USB connector directly to the L476 (ok, you can solder it with 2 resistors and a jack, but I really don’t understand the lack of this feature). @mouser you can grab it for 12.38 EUR (free shipping for orders > 50 EUR)
Right!
Anyway this is an issue only if you want to develop USB specific stuff (ie a hid device) else it can even be a simplification and space saving since you don’t have to deal with usb only to get a vcp..
[madias – Mon Sep 10, 2018 10:43 am] –[edogaldo – Mon Sep 10, 2018 9:53 am] –
To me the most valuable board would be the Nucleo-L476RG that you can find on ebay for about 20 bucks: https://www.ebay.com/itm/1PCS-NUCLEO-L4 … 2247257719This board *could* be superb, but one thing is missing: An USB connector directly to the L476 (ok, you can solder it with 2 resistors and a jack, but I really don’t understand the lack of this feature). @mouser you can grab it for 12.38 EUR (free shipping for orders > 50 EUR)
This was the one i honed in on after a bit of research, came back here for a look and saw this – have ordered one which will arrive tomorrow. Also started reading the datasheet. That’s a beast of a chip..
Thanks for the help all those who chipped in with comments and suggestions.
https://www.st.com/en/development-tools … inder.html
Honestly, I didn’t test it. Maybe it could be a good starting point to find one of the best candidate.

Drivers installed just fine, com port 7 showed up.
I uploaded the amended blinky code at the top of this thread…
…and it runs just fine ![]()

You might program the STM32F407 discovery with the cable connected to the Mini-USB ( which is the ST-Link programmer )
When you use the STM32GENERIC Core you can use the second USB connector ( Micro-USB ) as serial interface.
The hardware setup is as follows: Mini-USB connector for power supply and Micro-USB as serial interface.
[ChrisMicro – Fri Oct 12, 2018 8:00 pm] –
BTW just one hint.
You might program the STM32F407 discovery with the cable connected to the Mini-USB ( which is the ST-Link programmer )
When you use the STM32GENERIC Core you can use the second USB connector ( Micro-USB ) as serial interface.The hardware setup is as follows: Mini-USB connector for power supply and Micro-USB as serial interface.
Thanks Chris, I wish I’d just ordered a USB > Serial interface before murdering mine. I didn’t think of using USB like that! Doh!


