Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ESP32 #33

Merged
merged 5 commits into from
Aug 9, 2021
Merged

Conversation

brentru
Copy link
Member

@brentru brentru commented Aug 9, 2021

Adds SleepDog support for the ESP32

  • Uses the ESP32's as the Watchdog Timer (TWDT) for WDT-support since it can be configured during runtime.
    • Defaults to utilizing the current running task as a subscription for the TWDT.
    • Executes the ESP32's panic-handler TWDT times out
  • Adds timer-based low-power-sleep support for ESP32.

Tested with: Adafruit ESP32 Feather

BasicUsage

11:22:40.250 -> �Watchdog Library Demo!
11:22:40.250 -> 
11:22:40.250 -> Enabled the watchdog with max countdown of 4000 milliseconds!
11:22:40.250 -> 
11:22:40.250 -> Looping ten times while resetting the watchdog...
11:22:40.250 -> Loop #1
11:22:41.264 -> Loop #2
11:22:42.270 -> Loop #3
11:22:43.248 -> Loop #4
11:22:44.262 -> Loop #5
11:22:45.236 -> Loop #6
11:22:46.259 -> Loop #7
11:22:47.239 -> Loop #8
11:22:48.244 -> Loop #9
11:22:49.266 -> Loop #10
11:22:50.251 -> 
11:22:50.251 -> Get ready, the watchdog will reset in 4000 milliseconds!
11:22:50.251 -> 
11:22:54.295 -> E (28103) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
11:22:54.295 -> E (28103) task_wdt:  - loopTask (CPU 1)
11:22:54.295 -> E (28103) task_wdt: Tasks currently running:
11:22:54.295 -> E (28103) task_wdt: CPU 0: IDLE
11:22:54.295 -> E (28103) task_wdt: CPU 1: IDLE
11:22:54.295 -> E (28103) task_wdt: Aborting.
11:22:54.295 -> 
11:22:54.295 -> abort() was called at PC 0x400d5107 on core 0
11:22:54.295 -> 
11:22:54.295 -> 
11:22:54.295 -> Backtrace:0x400d5bc5:0x3ffbe7900x40086f91:0x3ffbe7b0 0x4008bf79:0x3ffbe7d0 0x400d5107:0x3ffbe850 0x40084275:0x3ffbe880 0x400e9f83:0x3ffbd3a0 0x400d5a02:0x3ffbd3c0 0x400882c0:0x3ffbd3e0 
11:22:54.295 -> 
11:22:54.295 -> 
11:22:54.295 -> 
11:22:54.295 -> 
11:22:54.295 -> ELF file SHA256: 0000000000000000
11:22:54.295 -> 
11:22:54.295 -> Rebooting...
11:22:54.332 -> ets Jul 29 2019 12:21:46
11:22:54.332 -> 
11:22:54.332 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
11:22:54.332 -> configsip: 0, SPIWP:0xee
11:22:54.332 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:22:54.332 -> mode:DIO, clock div:1
11:22:54.332 -> load:0x3fff0030,len:1252
11:22:54.332 -> load:0x40078000,len:12732
11:22:54.332 -> load:0x40080400,len:3100
11:22:54.332 -> entry 0x400805ec
11:22:54.436 -> Adafruit Watchdog Library Demo!

Sleep

11:23:49.026 -> Watchdog Library Sleep Demo!
11:23:49.026 -> 
11:23:49.026 -> Going to sleep in one second...
11:23:51.033 -> I'm awake now! I slept for 1000 milliseconds.

@brentru brentru requested a review from ladyada August 9, 2021 15:41
@brentru brentru merged commit 9d6f116 into adafruit:master Aug 9, 2021
@brentru brentru deleted the add-esp32-support branch August 9, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants