-
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
Sleep/deepsleep and Serial class #11361
Comments
Test application source code:
|
The deep sleep might be locked for some other reason? I can't see any reason for serial to be causing it here. Note that the |
As a fact, test board drawn 8..9 mA at point before create Serial object instance (tested with infinity loop with 1000 mS delay). After complete sending data rise to 40 mA. |
Oh, this is using the asynchronous API. I'm not familiar with that. Personally, I wouldn't recommend it - use Looking at it, deep sleep gets locked by the call to It should get unlocked when the transfer finishes - after txcb is called ( |
Yes, but power consumption sill high. |
There might be power drain over RX/TX pins after UART is initialized. Also #10924 might be interesting for you. |
I still can't see how this fails due to sleep locks. Do you have the ability to attach a debugger, and breakpoint It may be an issue in the STM HAL rather than the generic Mbed OS code. Looking at the implementation, maybe mbed-os/targets/TARGET_STM/sleep.c Lines 154 to 164 in 8ef742a
|
CC @LMESTM |
Could you try enabling MBED_SLEEP_TRACING_ENABLED ? |
@kjbracey-arm if you're right, then it's maybe time to address #4408 which is still open ... |
That'll teach me to open my big mouth. |
Your messageabout |
Note that this is related to #11401. Both platforms are doing the same basic thing with the "wait for serial in deep sleep call". |
How about add |
Can you elaborate some more about this proposal ? In your case, I'm not sure what the reason for not entering deep sleep. Or have you checked with CPU stats the % of time spent in each CPU state ? |
Next line after |
Ok that's the point. Can you also confirm your power figures by tracing as well CPU stats (% of time in idle / sleep / deep sleep ..) ?
Just to confirm. Are you measuring the MCU current only on the IDD measurement point or the complete board ? The board includes a 2nd STM32 in the st-link debug side of the board that you want to exclude from your power measurement ... |
Original ST-LINK V2 is not drawn significant current (only IO reference) - at programming stage I measure about 2 mA. I measure only MCU. Test code with deep aleep consume 18 mA, without - at 36..40 mA. |
Just made a quick test by modifying your code and adding tracing of CPU stats. It shows that deep sleep is well entered ...
|
and I also can reproduce the current consumption issue you're seeing
|
Description
Issue request type
target: NUCLEO_F446ZE
toolchain: 6 2017-q2-update
mbed_cli: 1.8.3
SHA: 1bf6b20 (HEAD, tag: mbed-os-5.13.4, origin/mbed-os-5.13)
On page https://os.mbed.com/docs/mbed-os/v5.13/apis/power-management-sleep.html mentioned about possibility of locking deepsleep from Serial class.
In test application I create instance of Serial.
Application send small amount of data and (after complete operation) invoke enable_input(false) and enable_output(false).
But, deepsleep still locked (and current indicator on test board say same).
It is a bug or expected behavior?
Configs on proper places:
and
"macros_add": ["MBED_TICKLESS"],
The text was updated successfully, but these errors were encountered: