diagnosing LowPower.deepSleep() behaviour
Posted: Thu Jun 17, 2021 3:32 pm
I'm trying to diagnose a strange deepSleep() behaviour on a custom designed PCB with STM32L412KBT6 with LSE. After a power up, the MCU deepSleeps/wakes up normally for 2-3 minutes, but after 2-3 minutes, the wake up does not happen.
Test setup:
- A single led is connected through a current limiting resistor to PA10, not other peripherals are connected.
- The minimal reproducing code is below (effectively a Blink).
- 2-3 minutes after the power up, the led stops blinking.
- LowPower.sleep(2000) instead of LowPower.deepSleep(2000) works as expected.
- Configuration used for uploading code: Board: "Nucleo-32", Board part number: "Nucleo L412KB"
- To no surprise, trying to connect to the MCU through SWD with STM32CubeProgrammer (I have the SWO pin connected) naturally resets the MCU.
Ideas on how to diagnose this further are much appreciated.
Versions:
- STM32 Core 1.9.0 (did not try 2.0.0 yet)
- STM32duino_Low_Power 1.1.0
- STM32duino_RTC at 1.1.0
- Arduino IDE 1.8.13
Test setup:
- A single led is connected through a current limiting resistor to PA10, not other peripherals are connected.
- The minimal reproducing code is below (effectively a Blink).
- 2-3 minutes after the power up, the led stops blinking.
- LowPower.sleep(2000) instead of LowPower.deepSleep(2000) works as expected.
- Configuration used for uploading code: Board: "Nucleo-32", Board part number: "Nucleo L412KB"
- To no surprise, trying to connect to the MCU through SWD with STM32CubeProgrammer (I have the SWO pin connected) naturally resets the MCU.
Ideas on how to diagnose this further are much appreciated.
Versions:
- STM32 Core 1.9.0 (did not try 2.0.0 yet)
- STM32duino_Low_Power 1.1.0
- STM32duino_RTC at 1.1.0
- Arduino IDE 1.8.13
Code: Select all
#include <STM32LowPower.h>
void setup() {
pinMode(PA10, OUTPUT);
LowPower.begin();
}
void loop() {
digitalWrite(PA10, HIGH);
LowPower.deepSleep(2000);
digitalWrite(PA10, LOW);
LowPower.deepSleep(2000);
}