On m5stack atom s3 watchdog is rebooting, but on m5stack atom watchdog is halting. #11963
Replies: 3 comments
-
| Figure out what is blocking the cpu and stop it from blocking. Typically this means adding delay/yield into your loops, so the the system has time to execute things while your code is blocked. | 
Beta Was this translation helpful? Give feedback.
-
| @jensolsson - It is interesting that the S3 reboots with WDT but the ESP32 doesn't. Both have the same Arduino WDT configuration in sdkconfig, therefore both should behave in the same way. CONFIG_ESP_TASK_WDT_INIT=y I have tested WDT with ESP32 and ESP32-S3 dev module boards (using the Espressif board selection from menu). If I select  
 Select  | 
Beta Was this translation helpful? Give feedback.
-
| In order to change the WDT Task setttings of the task that is runing  #include "esp_task_wdt.h"
//3 seconds WDT in the currect running Core (any IDE Menu selection)
#define WDT_TIMEOUT_MS 3000
#ifdef CONFIG_FREERTOS_UNICORE
#define CONFIG_FREERTOS_NUMBER_OF_CORES 1
#else
#define CONFIG_FREERTOS_NUMBER_OF_CORES 2
#endif
esp_task_wdt_config_t twdt_config = {
        .timeout_ms = WDT_TIMEOUT_MS,
        .idle_core_mask = (1 << CONFIG_FREERTOS_NUMBER_OF_CORES) - 1,    // Bitmask of all cores
        .trigger_panic = true, // enable panic reset if WDT is nor fed
    };
void setup() {
  Serial.begin(115200);
  Serial.println("Configuring WDT... " + String(CONFIG_FREERTOS_NUMBER_OF_CORES) + " cores");
  esp_task_wdt_deinit(); //wdt is enabled by default, so we need to deinit it first
  esp_task_wdt_init(&twdt_config); //enable panic so ESP32 restarts
  esp_task_wdt_add(NULL); //add current thread to WDT watch
}
int i = 0;
int last = millis();
void loop() {
  // resetting WDT every 2s, 5 times only
  if (millis() - last >= 2000 && i < 5) {
      Serial.println("Resetting WDT...");
      esp_task_wdt_reset();
      last = millis();
      i++;
      if (i == 5) {
        Serial.println("Stopping WDT reset. CPU should reboot in 3s");
      }
  }
} | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Board
M5Stack ATOM / M5Stack ATOM S3
Device Description
m5stack atom
m5stack atom s3
Hardware Configuration
none
Version
v3.0.5
Type
Question
IDE Name
Arduino IDE
Operating System
macOS
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
115200
Description
I try to support both and it is very important for me that the watchdog reboots the system if it is not fed. Is there any way to make it do so on Arduino for the non-s3 version of m5stack atom?
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
Beta Was this translation helpful? Give feedback.
All reactions