cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 runs only after flashing and not after that

SS.Sagar
Associate III

I am using STM32f103 and Cubemx ide. I implemented small project 1 month back and that time it was working fine but now when i am trying to use same code then i observed weired behaviour.

Code runs only after binary flashing and after that if i press reset then it doesn't work (executes only few function and gets stuck).

i tried to debug but facing some issue on Ubuntu.

3 REPLIES 3

Make sure that the BOOT pins are correctly set externally. BOOT0 should be pulled LOW​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

> executes only few function and gets stuck

How do you know it executes a few functions? Where does it get stuck?

If you feel a post has answered your question, please click "Accept as Solution".

Absent the ability to effectively debug via a debugger, one would want to make sure the HardFault_Handler() and Error_Handler() were capable of outputting some useful diagnostics rather than die silently in a while(1) loop. Ideally have output to a serial port, but minimally a GPIO or LED.

Have code early in Reset_Handler to indicate entry

Watch how you use auto/local variables, and that structures are cleanly initialized, make sure clear them, and the content is otherwise undefined, and liable to break the HAL library code.

Get a better debugging platform. Windows machines can be sourced for a few hundred dollars.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..