Hello Community,
I’m currently working with the Xiao-ESP32-S3 Sense module and encountering an issue with its light sleep mode. It seems that the ESP hangs when going into light sleep and never wakes up from timer, sometimes it gets a reset.
I also tried waking it up from GPIO and BLE, only deep sleep works.
Has anyone faced a similar issue or found a workaround?
This is the sketch - very simple:
#include <Arduino.h>
#include <esp_sleep.h>
void setup () {
Serial.begin(115200);
}
void loop () {
uint64_t sleepMicros = 850;
delay(100);
esp_sleep_enable_timer_wakeup(sleepMicros);
delay(100);
Serial.print("Sleeping: ");
Serial.println(sleepMicros);
delay(100);
uint32_t s = micros();
esp_light_sleep_start();
uint32_t e = micros();
Serial.print("Awake: ");
Serial.println(e - s);
delay(100);
}
this is the output from the serial monitor
10:25:03.758 → Sleeping: 850
10:25:03.758 → Awake: 1256
10:25:03.758 → Sleeping: 850
10:25:03.758 → Awake: 1087
10:25:03.758 → Sleeping: 850
10:25:03.758 → Awake: 1087
10:25:03.758 → Sleeping: 850
10:25:03.758 → Awake: 1086
10:25:03.758 → Sleeping: 850
10:25:03.758 → Awake: 1085
10:25:03.758 → Sleeping: 850
10:25:03.758 → Awake: 1087
10:25:03.758 → Sleeping: 850
10:25:40.724 → Sleeping: 850
10:25:40.724 → Awake: 1253
10:25:40.724 → Sleeping: 850
10:25:40.724 → Awake: 1082
10:25:40.724 → Sleeping: 850
10:25:40.724 → ESP-ROM:esp32s3-20210327
10:25:40.724 → Build:Mar 27 2021
10:25:40.724 → rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
10:25:40.724 → Saved PC:0x4201f276
10:25:40.724 → SPIWP:0xee
10:25:40.724 → mode:DIO, clock div:1
10:25:40.724 → load:0x3fce3808,len:0x44c
10:25:40.724 → load:0x403c9700,len:0xbd8
10:25:40.724 → load:0x403cc700,len:0x2a80
10:25:40.724 → entry 0x403c98d0
10:25:41.018 → Sleeping: 850
10:25:41.090 → Awake: 1252
10:25:41.397 → Sleeping: 850
10:28:09.266 → eeping: 850
10:28:09.266 → Awake: 1081
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1082
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1082
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1081
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 10811079
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1079
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1079
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1079
10:28:09.266 → Sleeping: 850
10:28:09.266 → Awake: 1079
10:28:09.266 → Sleeping: 850
10:28:09.266 → ESP-ROM:esp32s3-20210327
10:28:09.266 → Build:Mar 27 2021
10:28:09.266 → rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
10:28:09.266 → Saved PC:0x4201f276
10:28:09.266 → SPIWP:0xee
10:28:09.266 → mode:DIO, clock div:1
10:28:09.266 → load:0x3fce3808,len:0x44c
10:28:09.266 → load:0x403c9700,len:0xbd8
10:28:09.266 → load:0x403cc700,len:0x2a80
10:28:09.266 → entry 0x403c98d0
10:28:09.532 → Sleeping: 850
I appreciate any suggestions or guidance you can provide. Thank you for your time and assistance.