2015-03-11 10:12 AM
I am running STM32F407 with IAR EW toolset and trying to put the CPU into sleep mode.
The processor never stops at __WFE( ).Any idea what I am doing wrong?2015-03-11 10:37 AM
Any idea what I am doing wrong?
No, are you observing from a debugger?2015-03-11 11:02 AM
I just read your comment about the STM32F407 errata.
I just read the errata. I examined DBGMCU_CR and all bits are zero.Still no sleep mode with ST-LINK disconnected. It is either it never goes to sleep or something is waking up the CPU.2015-03-11 12:25 PM
It appears I made a mistake somewhere.
When I remove the debugger it appears to work properly.2015-03-14 07:07 AM
I have two STM32F407 MCU running identical code. They go to sleep when I stop using the debugger.
I need each CPU to go to sleep one time on power-up. An external event on a GPIO pin wakes the CPU.One MCU works perfectly everytime. The second one goes to sleep intermittently.I found that both chips will wake up with USART interrupt. That surprised me because I thought that it would wake up from WFE only on an event and not interrupts.It appears that the misbehaving CPU is experiencing some interrupts or events that I am not aware of. I have disabled all activity and enabled only one GPIO (PB15) input for event mode.Still stumped!