I've just got a new STM32F103 board instead of the F3 Discovery, can't get OpenOCD working, so I'm stuck with ST-Link for re-flashing. And I've spent 3 to 4 hours today trying to figure out why my firmware wouldn't work. Well, I just found out: everything works, but ST-Link will only flash once, and then won't update the firmware unless I restart the program, although success is always reported! Pressing "reset" on the board manually also has no effect. So:

  1. Open ST-Link, program - OK; edit the code and rebuild hex, program - not OK. Fiddle with all the ST-Link commands including chip erase - still not OK.
  2. Open ST-Link, program - OK; edit the code and rebuild hex, close ST-Link and reopen it, program - OK!

Doing menu -> Target -> Compare device memory with ***.hex also always finds no difference unless I re-run ST-Link. It's as if it is caching the .hex somewhere in its memory with no regards for its changes on the disk.

It's not that I can't be bothered re-run ST-Link every time, but what's going on? My pet project depends on STM32, I'm behind schedule, other people are waiting for me, and every time I have to make changes to the setup something new breaks. I need to improve my understanding of STM32 environment ASAP to avoid further problems.

  • \$\begingroup\$ How about you reinstall the ST-link application? Update the Drivers? Look for the solution on ST Support Forums. They have absolute support on all products. You want another suggestion? Try doing it on another PC. If the problem persists, the board may be faulty. MAY BE! \$\endgroup\$
    – ammar.cma
    Dec 7, 2015 at 20:41
  • \$\begingroup\$ @ammar.cma: 2 different PCs tried, both had ST-Link installed today. ST Forums are OK, I guess, but response times upwards of 24 hours won't cheer me up in this particular case :/ How is this a board fault? Looks definitely like ST-link bug to me. \$\endgroup\$ Dec 7, 2015 at 20:48
  • \$\begingroup\$ If the board is programmed every time the software is re-opened; i don't think there is a problem with the board. The programming software maybe buggy?. If you want fast development on ST Boards; try using CooCox. Easier and faster to use. \$\endgroup\$
    – ammar.cma
    Dec 7, 2015 at 20:52

1 Answer 1


You need to reopen the hex file after an external rebuild 'file' -> open. The hex file gets loaded in memore and won't be reopened if changed in memory.

  • \$\begingroup\$ Yep, it seems to be by design - a pretty bad decision, IMO. \$\endgroup\$ Dec 8, 2015 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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