cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 lockup

owen
Associate
Posted on June 17, 2012 at 15:35

  I am working on some code for the STM32F407 and ran into interesting problem.  When switching power to the board off and on quickly, the processor can become stuck on reset, often dropping to hardfault handler. 

  This is not really surprising, but sometimes the processor remains in this locked up state.  Neither reset or power cycling the entire system can free it.  The only way to get it to start up again is to re-flash.  From initial investigations it appears its dropping very quickly into hardfault, and working on getting more info.  But what is confusing is how power cycling the board doesn't fix, since it was my understanding that this restores all the registers to their defaults.  Is it possible the flash got corrupted somehow? 

#rese #stm32f4 #hardfault #lockup
2 REPLIES 2
Posted on June 17, 2012 at 15:45

Is it possible the flash got corrupted somehow?

Read back the content and check.

Check how you are setting the BOOT0 and BOOT1 pins at boot time.

Make sure you have adequate bulk capacitance on you supply pins, and observe the supply on a scope as you switch on the supply. Confirm it stays within limits, or what rise time it has.

Consider trying an external power-on-reset (POR) circuit which clamps RESET to ground for a 100 ms or so, and see if that improves behaviour. These generally work profoundly better than RC circuits on the reset pin.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
owen
Associate
Posted on June 17, 2012 at 16:52

Thanks for your response !

   BOOT0 is tied to ground with 1k.  BOOT1 is floating  (I thought this was OK as long as BOOT0 is low, no?)

   The power line doesn't have any abnormality when observed with scope... but I like the idea of a POR circuit with clamp on rst...

   working on getting full image back out, but stepping through, it looks like after 8000316  the flash is made up entirely of 

movs r0, r0

     I didn't think a quick drop in power would have this effect on the flash ??