Skip to main content
SS.Sagar
Associate III
November 25, 2021
Question

STM32F103 runs only after flashing and not after that

  • November 25, 2021
  • 3 replies
  • 1548 views

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.

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
November 25, 2021

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

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
TDK
November 25, 2021

> 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""."
Tesla DeLorean
Guru
November 25, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..