-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EFM32: Sleep function does not cause the MCU to go to a sleep mode #4082
Comments
I had a similar problem with the PG, it's to do with sleep being disabled in debug builds. #ifdef NDEBUG
#if DEVICE_SLEEP
hal_sleep();
#endif /* DEVICE_SLEEP */
#endif /* NDEBUG */ if you define NDEBUG it should sleep correctly. |
Also you may need to power cycle the processor to get it out of debug mode after programming or it still wont sleep. |
Thanks @chrissnow, this seemed to be the problem indeed! I did not know about the It would be nice to have this sort of stuff documented on e.g the Power-Management cookbook. Notice the example won't work in the Debug build (which seems to be the default). Edit: I checked: the |
Actually I think we need to update that, and made the board not go to sleep only in the |
@bulislaw great, thanks. Let me know if I can be of help, I'm currently looking into the power consumption of leuart on the EFM32 Happy Gecko and I'm building up some interesting scope images. |
#4097 changes to sleep |
ARM Internal Ref: MBOTRIAGE-360 |
Closing as issue appear to be fixed. |
In mbed-os 5 and later versions of the mbed 2 SDK (aka mbed-dev), the
sleep()
function does not cause EFM32 MCUs to sleep properly, even when no sleep levels have been blocked.When testing on the EFM32 Happy Gecko 322 using the EFM32HG_STK3400 target the MCU still consumes 3.49mA at 3v3 when calling
sleep
in a loop. I was able to reproduce this in:I tested both on the STK3400 devkit and a custom breakout board for the EFM32HG322 MCU.
Using mbed-dev at revision d6373279a6f1 using a custom build script and the mbed online compiler I did not have this issue yet. I am still trying to build this revision using the mbed tools.
I still plan to test on other EFM32 MCU's, but since a lot of code is shared I'm guessing the results will be similar.
Bug
Target
EFM32
Toolchain:
GCC_ARM
Toolchain version:
4.9.3
mbed-cli version:
1.0.0
The text was updated successfully, but these errors were encountered: