cancel
Showing results for 
Search instead for 
Did you mean: 

MCU starts code if I do a hardware reset!

BS.2
Associate

Hello,

I'm working with STM32F427VIT6 microcontroller.

BOOT0 is connected to GND through 10K resistor. The NRST state is high.

My problem is when I power up the board, the microcontroller code execution seems to not start. The execution only starts if I give a hardware reset(Push button) in NRST pin. The code only works if I force a hardware reset (NRST = 0).

While debugging i observed that, if i connect external RTC battery to microcontroller(Always), Only first time, code does not start. If i power up second time, code will start working without doing hardware reset. After that if i do N number of power cycles(ON/OFF), code starts work without giving hardware reset.

Is there anything resetting the microcontroller during power OFF condition ? Because if i give RTC power continuously to the microcontroller then it works without any hardware reset.

Secondly i believe that above are two different issues and may not be linked to each other. How ever the fact is that my controller doesn't execute first time when power is ON (After inserting the RTC battery first time, powerup the board).

Kindly help me in resolving this issue.

3 REPLIES 3

Late model STM32 tend to have slight differences in Power Cycle vs NRST, mostly in regards to how Options Bytes and protection mechanism information is latched. This mainly relates to potential attack vectors, like glitching.

If BOOT0 is low, the slow rises time and floating inputs should not be an issue. Chances are your code is running, and failing in some fashion, perhaps in a while() loop someplace or Error_Handler() when something doesn't start as expected. I'd recommend getting a GPIO pin functional in the Reset_Handler, and using that to flag startup rather than failure deeper into the SystemInit() and main() levels. Add additional checkpoints to understand flow.

On the F4 watch the VCAP pins and the capacitors you have on those. The core is running at around 1.25V, and can be somewhat viable below that. The core can also potential run from voltages on the IO pins via the ESD diodes. A robust synchronous design should have a POR that thresholds at a quite high voltage, perhaps 90% of nominal.

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

NRST=high is not enough information. What is the schematic?

ARM parts have a hazard if the NRST/NRESET type pins are driven by push-pull drivers from other devices in the circuit. Not clear that's the issue here.

I'm still of the opinion the part is running, is running customer code, and is failing in code paths therein.

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