cancel
Showing results for 
Search instead for 
Did you mean: 

Hard fault from waking up from low-power sleep

shotaro
Associate II
Posted on April 11, 2012 at 02:22

I seem to run into a lot of issues!

I'm trying to get my STM32L Discovery board to wake up from low-power sleep with the Flash turned off. I'm using the User button (tied to PA0) to wake it up as an external interrupt. But whenever I push the button when the part goes to sleep, it hard faults. If I don't do anything with Flash, the part goes to sleep and wakes up just fine. Is there a way I can turn off Flash and wake up the part without hard faulting?
1 REPLY 1
Posted on April 11, 2012 at 03:42

Using these parts is a non-trivial exercise, you just have to consider the consequences and pitfalls of what you choose to do. Generally before the internet we used to have to solve our own problems, or call the local FAE.

With a reasonable Hard Fault handler you should be able to have a look at the core registers and state, that might give you some pointers to the failure point or mode. Ideally it would decode the state without having to dig through the documentation all the time.

Now absent some specific details, and not using the STM32L's much, I'm going to hazard that you would probably need to have the vector table in RAM, and only call routines that reside in RAM, when the FLASH is not working. The loop/code turning off FLASH would need to be in RAM.

I'd have to imagine the RAM, or a portion of it, is maintained, otherwise things like the stack and return addresses would get messed up.

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