cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware only runs when I press the reset button.

Eduardo Cardoso
Associate

831/5000

I've created a board using the STM32F405R6T6.

I am experiencing some problems with the card, after I record the firmware on the microcontroller, withdraw the power and reinsert, the firmware only starts to run when I press the reset button.

In the debug it works, I record during the debug and it is already running, but when I save the card in release mode there is a need to press the reset button.

I thought it might be something related to the bootloader circuit, or even the proximity of reset capacitor, I've attached the circuits below, if someone has already gone through it or has a hint how could solve the problem, I'll be extremely grateful.

Sometimes during recording it also gives the following error "error erasing flash with vflasherase packet". Sometimes the error disappeared when activating boot, but not always.

0690X0000088aD9QAI.png0690X0000088aD4QAI.png0690X0000088aCzQAI.png

SOLUTION: Thanks for the comments, I found the problem. I currently have a switched source (L7981A) that converts the input voltage. The time for the voltage to go from 0V to 3.3V was 35ms (I looked at the oscilloscope). Removing this switched source and externally feeding system works perfectly. I'll have to rethink the source with the L7981 and see why it takes so long to get to the output voltage.0690X0000088bPQQAY.png

1 ACCEPTED SOLUTION

Accepted Solutions

Add code in Reset_Handler to drive a GPIO so that you can see if it entered there, and failed later.

Make sure you instrument Error_Handler and HardFault_Handler to see if it gets there.

Make sure BOOT0 is LOW at startup, if it ramps or is indeterminate you will have a problem.

Have a proper POR circuit wired to NRST. One that thresholds the 3.3V supply (at say at least 2.7V) and clamps NRST for 100-200ms once the supply threshold is hit.

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

View solution in original post

2 REPLIES 2

Add code in Reset_Handler to drive a GPIO so that you can see if it entered there, and failed later.

Make sure you instrument Error_Handler and HardFault_Handler to see if it gets there.

Make sure BOOT0 is LOW at startup, if it ramps or is indeterminate you will have a problem.

Have a proper POR circuit wired to NRST. One that thresholds the 3.3V supply (at say at least 2.7V) and clamps NRST for 100-200ms once the supply threshold is hit.

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

Sometime also once the SW start it might configure the IO to power droop while unstable. Add a 10 msec delay after startup to see if it helps. If you have a scope, probe Vdd rampup shape, maybe it goes up too slowly?