STM32F407 not going to sleep on __WFE()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-11 10:12 AM
Posted on March 11, 2015 at 18:12
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?
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-11 10:37 AM
Posted on March 11, 2015 at 18:37
Any idea what I am doing wrong?
No, are you observing from a debugger?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-11 11:02 AM
Posted on March 11, 2015 at 19:02
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-11 12:25 PM
Posted on March 11, 2015 at 20:25
It appears I made a mistake somewhere.
When I remove the debugger it appears to work properly.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-14 7:07 AM
Posted on March 14, 2015 at 15:07
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!