AnsweredAssumed Answered

WFI in run mode causing Hard Fault

Question asked by alokm on May 18, 2012
Latest reply on May 21, 2012 by John F.
hi all,

I want to save power in run mode of mcu (STM32L151)
My timer is running and giving periodic interrupts. My plan is to go to sleep mode when all main loop work is done and then wake up when timer interrupt comes.

strangely, when WFI is called, the mcu goes into hard fault. It does not happen always but quite frequenctly. I see the hardfault when my debugger (Jlink in SWD mode) is connected.

Can this hardfault be because of debugger ?
i have used Sleep mode in other conditions, i dont see any issue...only when doing in main loop...Hardfault comes.Has anyone used entry into SLEEP mode in while(1) loop ?

Thanks for you help 

Outcomes