Hello, I have no chance to get my device (NUCLEO_L073RZ) to deep sleep.
OS version: mbed-os-5.15
IDE: Mbed Studio Desktop
toolchain: GCC_ARM
mbed_app.json:
{
"config": {
"thread_stack_size": {"value": 1024},
"main_stack_size": {"value": 1024}
},
"target_overrides": {
"*": {
"platform.stdio-convert-newlines": true,
"platform.stdio-baud-rate": 115200,
"platform.cpu-stats-enabled": true,
"platform.memory-tracing-enabled": true,
"target.stdio_uart_tx": "PA_9",
"target.stdio_uart_rx": "PA_10",
"target.lpticker_lptim": 0,
"events.use-lowpower-timer-ticker": true
}
},
"macros": []
}
main.cpp
#include "mbed.h"
#include "mbed_stats.h"
int main(void){
while (1) {
wait_ms(4000);
mbed_stats_cpu_t stats;
mbed_stats_cpu_get(&stats);
printf("Uptime: %llu ", stats.uptime / 1000);
printf("Sleep time: %llu ", stats.sleep_time / 1000);
printf("Deep Sleep: %llu\n", stats.deep_sleep_time / 1000);
}
}
Console ouput:
Uptime: 15909 Sleep time: 15868 Deep Sleep: 0
Uptime: 19925 Sleep time: 19872 Deep Sleep: 0
Uptime: 23941 Sleep time: 23876 Deep Sleep: 0
As you see the Device never entered into deep sleep mode, I have no clue how I can enable the deep sleep when it enters into wait_ms().
I read a very well explained instructions (HERE) but doesn’t work on my device NUCLEO_L073RZ.
Could somebody help me to set my device into a deep sleep?
Thanks