cancel
Showing results for 
Search instead for 
Did you mean: 

why does the microcontroller lose the program when power is off?

shotkyy
Associate II

How can I avoid this?

10 REPLIES 10
S.Ma
Principal

If you have an external crystal, you can check if it oscillate and the core is clocked. HSI is supposed to be the backup internal clock.

Most importantly, if your code works with STLink, does your MCU gets 3.3V from USB Device regulator properly?

Grab an oscilloscope and look at your signals and supplies.

If your code works with debugger it means it is in the flash already.