[SOLVED] Unwanted wakeup from sleep via serial
Posted: Thu May 14, 2020 6:16 am
Hi,
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:
Connecting an oscilloscope to the builtin LED pin, I can see it switching on and off rapidly when there's activity on the USART interface. This only seems to happen when using LowPower.sleep() and only after the USART interface is initialized via GpsSerial.begin(9600)
Is there something I missed in the configuration? Does the serial wakeup need to be explicitly disabled?
Thanks!
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!