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:
- 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.
- 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.