I'm using Nucleo L452RE-P, and I'm having some issues with sleep mode. I have external device (GPS receiver) connected to UART4 on pins PA0 and PA1. For some reason, when going to sleep mode using the STM32LowPower library, the STM32 will wake up whenever there's some data on the USART port. See the slightly modified TimedWakeup example below:
Code: Select all
#define GPS_TX PA0
#define GPS_RX PA1
#include "STM32LowPower.h"
HardwareSerial GpsSerial(GPS_RX, GPS_TX);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
GpsSerial.begin(9600);
// Configure low power
LowPower.begin();
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
LowPower.sleep(1000);
digitalWrite(LED_BUILTIN, LOW);
LowPower.sleep(1000);
}
Is there something I missed in the configuration? Does the serial wakeup need to be explicitly disabled?
Thanks!