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" );