-
Notifications
You must be signed in to change notification settings - Fork 3k
DISCO-L475VG-IOT01A wakes up every second #10211
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
Comments
Hi @janjongboom Could you try adding |
This can be related to the maximum timeout period that can be programmed in HW, |
@LMESTM @jeromecoutant Yeah that works indeed! Which brings me to the question on why we aren't using this clock by default. Is there perhaps an application note on picking lpticker clock sources on STM32? |
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-1057 |
Hi gents. |
@elforce what do you exactly want to solve ? Note: In your above mbed_app.json extract I do not see Jerome recommendation: |
@LMESTM If the device is working on the battery, eg. CR2032, and need to send data every 1 hour then should be in stop mode about 99.9% and wake only to send the data. Waking it up every 1s with mbed-os 5 from stop mode with the cyclical momentary power consumption about 1mA, it will drain the battery quite quickly. My question is how to be in stop mode and have the same behaviour like in mbed 2, static power consumption at the level of a few uA (with peripheries) all time? In mbed-os 5 with ST uC's (I do not know how with others) in stop mode current consumption is not static (tested on STM32L476 and STM32L432). For example about 8 minutes beeing in stop mode with this peaks is equivalent to sending 1 LoRaWAN frame. I think that is a big problem that's why @janjongboom reported it as a Bug. |
@ARMmbed/mbed-os-core this is a question to you - not something specific to STM32. Users are asking for vert long period of Deep Sleep without any wake-ups (RTC alarm like I think). |
I have RTC running in the project and I wake up the device every 30 min, 1h, 3h. There is no problem with that. Probably this 1s awakening are needed for the mbed-os itself so that it can validate events or other stuff. @ARMmbed/mbed-os-core even if it can not be turned off, how this 1s peaks time can be extended? |
@elforce Out of curiosity, what RTC alarm API are you using ? |
It should not matter because I did tests without and with supported RTC. I am using mbed-os rtc_api functions: rtc_read() and rtc_write() but to set Timer and Alarm I use my own functions written using HAL libraries. |
That was my point. As of now, there is no standard MBED API in case you want to sleep for hours without any wake-up.
The 1sec wake-up is due to the wrap-around of the 16 bits LPTIM HW in STM32. Scheduler relies on this continuous always-running clock and will always schedule next interrupt within a few seconds to count for the next wrap-up. So as long as RTC is not used, you will have wake-ups every seconds or so. |
Internally for the mbed-os operation, the system does not use the RTC clock and there is probably a problem here. Although my overwrites and reconfigures the RTC, the peak problem still exists every 1s. |
Calling osKernelSuspend () does not work. Maybe I do not comply with conditions to stop the Kernel scheduler. |
@MarceloSalazar - in case you can help. |
Hi Should we keep this issue opened on ST side ?
@bulislaw @kjbracey-arm Thx |
I agree that this is not st specific. |
Don't think so. My input: Suspending the kernel does not in itself do anything to stop the timer. Normally when the kernel is suspended, we want the timer to carry on running, so we know how long we were asleep for. Therefore in this case the device wakes up periodically to note the timer wrap. (Or to run any other scheduled events). This would be less of a problem on a chip with a slower-wrapping timer. If you really want to stay asleep in this scenario, then you will need to mask off the interrupts you don't want - have a limited set of "wake" interrupts. This is something we're planning to do - have a "system suspend" that masks off all interrupts except a specific set, then calls kernel suspend. You can experiment with this sort of thing yourself. As of 5.14 you can do this
There are a bunch of tricky race issues there (eg what if someone else is messing with interrupt masks after we record it - might not restore it accurately), but basic concept should force the system down. If we wanted to time the sleep we have more work to do - we'd want to stop the LPTIM and instead time it with the RTC. (And maybe use RTC as a wakeup source). Getting that all done smoothly and neatly and generically is a work package, but for a local app you can kind of do whatever you need manually. |
Maybe, you should then remove the "device st" label, |
we closed the issue as we have feature request for this being tracked separately. |
For anyone running into this, I put together a quick standby example for STM32 on Mbed OS some years ago: https://github.com/janjongboom/stm32-standby-rtc-wakeup |
Uh oh!
There was an error while loading. Please reload this page.
Description
This is a power profile of 10 second blinky on DISCO-L475VG-IOT01A. Every second the MCU wakes up. What's going on here?
main.cpp
mbed_app.json
Mbed OS 5.12 (pre-release) rev. 7dd791e compiled with GCC ARM 6.
Issue request type
The text was updated successfully, but these errors were encountered: