2020-10-12 01:54 AM
I am using STM32F103C8T6 with libopencm3 and FreeRTOS. Some programs I have can only flash once, even though the code function properly. The second time I flash it will say something like "unknown chip id! 0x3748. Failed to connect to target". I have to set boot0 jumper to VDD, and issue "st-flash erase" from console, then set boot0 jumper back to GND to reset the board.
My question is: Is this normal? If not, what could be the problem? How can I narrow down the issue? It really is inconvenient to go through so many steps to flash a new code.
2020-10-12 01:59 AM
Check that you do not have a STM32F103 clone!
2020-10-12 02:01 AM
No. It is from STM.
2020-10-14 12:47 AM
In case anyone curious about what happens to this problem, I found I have disabled JTAG and SWD accidentally in the programs so the flash function is not working.
About the approach I used to debug this problem, I disable my program block by block until I narrow down the problem.