I ordered an STM32F4xx board to use it in an embedded systems class a couple months ago. It has arrived yesterday and I figured out it does not have the ST Link module included.

How can I program it? I understand I can get an STLink module, but i would like to know if there is another way.

STM32F4 board

  • 1
    \$\begingroup\$ What does the Manual for the device recommend for programming? \$\endgroup\$ – Tyler Nov 3 '17 at 2:33

While you can use the serial or (on the `407 USB or several other interfaces) bootloader, realistically, you should get a cheap SWD adapter.

You can even use a Discovery board for any SMT32 variant for this purpose, if you remove the jumpers that connect the stlink to the on-board target.

While the bootloader gets you only code loading, the SWD interface (with any of ST's Windows software, or on Linux/Mac either of Texane's open source tool, or OpenOCD) gets you code loading and the ability to have a breakpoint debugger.

  • \$\begingroup\$ So a ST Link Programmer should do the trick? goo.gl/8LwU46 \$\endgroup\$ – PySerial Killer Nov 3 '17 at 2:59
  • \$\begingroup\$ youtube.com/watch?v=KgR3uM21y7o \$\endgroup\$ – Rusty Nail Jun 3 at 1:45
  • \$\begingroup\$ Beware that most knock-off STLINK adapters are miswired internally in a way that leaves them unable to actually assert the reset line on command. They work when a chip is in a typical configuration where the reset isn't needed so this is not immediately apparent, but because they don't actually drive it when commanded to they won't unbrick one in a bad state, and can't wakeup one that is in certain sleep modes. \$\endgroup\$ – Chris Stratton Jun 3 at 3:08

Try UART interfacing. I also bought STM32F104 board and it works just fine when I connected with USB-> UART connection(TX and Rx pins). If the board comes with Bootloader ,then it should work with UART. Try connection with UART( if you have Arduino or Ch304G or whatever UART USB interface you have. Download ST flash loader and check for detection of your UART in the software. Click next ,then you should see "target readable", then you can program using UART. If not , you should buy one ST-link. Try connection USB and check with Flashloader, sometimes it might work

  • 1
    \$\begingroup\$ It's not a question if the board comes with a bootloader, the chip comes with one in ROM. But that's far more limited for development than a $5-10 SWD interface. \$\endgroup\$ – Chris Stratton Nov 3 '17 at 2:51
  • \$\begingroup\$ Okay, most of the case ,it comes with bootloader. Don't think about that for now. Try connection with USB- UART and check with software. \$\endgroup\$ – Aadarsh Nov 3 '17 at 2:55
  • \$\begingroup\$ @ChrisStratton I understand , the solution is just for programming ,not for debugging. When getting started, atleast he should figure a way to program it to get some work done. \$\endgroup\$ – Aadarsh Nov 3 '17 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.