cancel
Showing results for 
Search instead for 
Did you mean: 

Why my MCU doesn't work when powerup? It only starts code if I do a reset!

Luis Ber
Associate II

Hello,

I have a problem that I don't know to solve and any help will be appreciated very much.

I'm working with STM32L476RCT, and BOOT0 is configured to 0 to boot from flash. The NRST state is also correct.

My problem is when I program the mcu, the code seems to not start. The execution only starts if I do a hardware reset in NRST pin. It also doesn't work when I power up from power off. The code only works if I force a hardware reset (NRST = 0).

I'm sure that is a problem of the firmware because I have tested the MCU with other code and it works properly. I'm working with Eclipse Workbench.

Any tip or indication will be a big help to me.

Thank you very much,

Luis

18 REPLIES 18
turboscrew
Senior III

What happens when you first start debugging? It doesn't stop at the beginning of main? Does it run? Is there a (temporary) breakpoint at the beginning of main?

BrokenICry
Associate

Have you ever found a solution to this ??

I have the same problem right now with cubeIDE, using the F401RE chip.

ls_andre
Associate

Try writing a one second delay loop before the "SystemClock_Config();" statement.

Probably you are going to configure the PLL before the external oscillator has fully woken up.

This would lead the code to fall into the Error_Handler() loop.

Hi sir,

Did you manage to solve the problem?

Thanks!

Rather than try and wake a 2 year old thread please start a new thread stating you situation and design specifics.

Most problematic startup situations revolve around slow power supply rise times, and indeterminate boot pin settings.

More often that not your code does actual run, but it is broken, or dies silently in a while(1) loop somewhere.

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

I have same issue with F303-re nucleo and have manage to fix it by updating ST-Link to Debug+MassStorage+VCP. After update code startup at power-up.

FValm.1
Associate III

Same issue here and I followed the tip by @Is_andre to solve the problem. But in my case I needed 2 seconds to wait before the "SystemClock_Config();" statement!

Yas Yasin
Associate II

Hi all

I had the same problem and finally I figured out the BOOT0 pin was not pulled low.

Thanks

This worked out for me. I was worried as all my custom boards started having this issue.