STLink debugger doesn't come back from deepsleep
Posted: Thu Jun 18, 2020 7:49 am
Hi all,
I am using the LowPower and STM32RTC libraries for the Arduino Core, using platformio, to put my device into a 1 minute wake/sleep cycle. After 4 sleep cycles there is a problem which I want to debug using my STLink debugger (and gdb).
This is the code to put it to sleep
This works fine normally, but once I run the code in debug mode using the debugger, the device never comes out of deepSleep. If I abort the code, it seems to be stuck in
Is there any way to get the deepSleep to work with the stlink debugger so I can debug the actual problem that I am having?
I am using the LowPower and STM32RTC libraries for the Arduino Core, using platformio, to put my device into a 1 minute wake/sleep cycle. After 4 sleep cycles there is a problem which I want to debug using my STLink debugger (and gdb).
This is the code to put it to sleep
Code: Select all
STM32RTC &rtc = STM32RTC::getInstance();
LowPower.enableWakeupFrom(&rtc, wakeup, &data);
uint32_t now = rtc.getEpoch();
rtc.setAlarmEpoch(now + sleep_time);
LowPower.deepSleep();
Code: Select all
/system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c:120
120 __asm volatile( "nop" );