From 13ee648e3dc92f6cedbeb8c8c3215642fa9bd0f1 Mon Sep 17 00:00:00 2001 From: Austin Lane Date: Fri, 24 Apr 2026 20:59:49 -0400 Subject: [PATCH] Fix ESP32-C6 linker errors. Align .text.handler_execute section to 4 bytes and update watchdog timer core mask configuration Co-authored-by: Copilot --- src/platform/esp32/align-text.handler_execute-4.ld | 2 +- src/platform/esp32/main-esp32.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/esp32/align-text.handler_execute-4.ld b/src/platform/esp32/align-text.handler_execute-4.ld index e747edcc4..fca4f27a2 100644 --- a/src/platform/esp32/align-text.handler_execute-4.ld +++ b/src/platform/esp32/align-text.handler_execute-4.ld @@ -1,7 +1,7 @@ /* Arduino fix: catch esp_event's orphaned .text.handler_execute section and align to 4 bytes */ SECTIONS { - .text.handler_execute : + .text.handler_execute ALIGN(4) : { KEEP(*(.text.handler_execute)) KEEP(*(.text.handler_execute.*)) diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index c57cc685e..6e61032b2 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -168,7 +168,7 @@ void esp32Setup() #if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t)); wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000; - wdt_config->idle_core_mask = 1 << 1; + wdt_config->idle_core_mask = (1 << CONFIG_FREERTOS_NUMBER_OF_CORES) - 1; wdt_config->trigger_panic = true; res = esp_task_wdt_init(wdt_config); assert(res == ESP_OK);