for some reason calling the function esp_flash_read(), while CONFIG_FREERTOS_UNICORE is not set, times out the watchdog. This function gets called for example while calling esp_vfs_littlefs_register() or nvs_flash_init(). Before printing the backtrace it prints this log:
Code: Select all
E (330090) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (330090) task_wdt: - IDLE1 (CPU 1)
E (330100) task_wdt: Tasks currently running:
E (330100) task_wdt: CPU 0: IDLE0
E (330100) task_wdt: CPU 1: main
E (330100) task_wdt: Print CPU 1 (current core) backtrace
The things that are same in every backtrace are:
Code: Select all
--- 0x4202057e: task_wdt_timeout_handling at /home/andy/.espressif/v6.0/esp-idf/components/esp_system/task_wdt/task_wdt.c:436
--- (inlined by) task_wdt_isr at ~/.espressif/v6.0/esp-idf/components/esp_system/task_wdt/task_wdt.c:509
--- 0x40377971: _xt_lowint1 at ~/.espressif/v6.0/esp-idf/components/xtensa/xtensa_vectors.S:1240
--- 0x400559dd: _xtos_set_intlevel in ROM
(some FreeRTOS functions, always different)
--- 0x40375602: spi_flash_disable_interrupts_caches_and_other_cpu at ~/.espressif/v6.0/esp-idf/components/spi_flash/cache_utils.c:153
--- 0x4037548a: cache_disable at ~/.espressif/v6.0/esp-idf/components/spi_flash/spi_flash_os_func_app.c:78
--- 0x40375464: spi1_start at ~/.espressif/v6.0/esp-idf/components/spi_flash/spi_flash_os_func_app.c:136
--- 0x40385d01: spiflash_start_core at ~/.espressif/v6.0/esp-idf/components/spi_flash/esp_flash_api.c:226
--- 0x40385d24: spiflash_start_default at .espressif/v6.0/esp-idf/components/spi_flash/esp_flash_api.c:237
--- 0x403856a3: esp_flash_read at ~/espressif/v6.0/esp-idf/components/spi_flash/esp_flash_api.c:969
some examples of what functions can be in the backtrace (a lot of the times no FreeRTOS function is there):
Code: Select all
--- 0x4037d497: vPortClearInterruptMaskFromISR at ~/.espressif/v6.0/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:547
--- (inlined by) vPortExitCritical at ~/.espressif/v6.0/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:518
--- 0x420ca53d: vTaskSuspendAll at ~/.espressif/v6.0/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:2523
Code: Select all
--- 0x4037d4fd: vPortYieldOtherCore at ??:?
Code: Select all
--- 0x420c8701: vPortClearInterruptMaskFromISR at ~/.espressif/v6.0/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:547
--- (inlined by) xTaskGetSchedulerState at ~/.espressif/v6.0/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:5031
--- (inlined by) xTaskResumeAll at ~/.espressif/v6.0/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:2597
Code: Select all
I (24) boot: ESP-IDF v6.0 2nd stage bootloader
I (25) boot: compile time Jun 23 2026 16:51:49
I (25) boot: Multicore bootloader
I (25) boot: chip revision: v0.2
I (27) boot: efuse block revision: v1.4
I (31) boot.esp32s3: Boot SPI Speed : 80MHz
I (35) boot.esp32s3: SPI Mode : DIO
I (39) boot.esp32s3: SPI Flash Size : 16MB
I (43) boot: Enabling RNG early entropy source...
I (47) boot: Partition Table:
I (50) boot: ## Label Usage Type ST Offset Length
I (56) boot: 0 nvs WiFi data 01 02 00009000 00005000
I (62) boot: 1 otadata OTA data 01 00 0000e000 00002000
I (69) boot: 2 app0 OTA app 00 10 00010000 003f0000
I (75) boot: 3 app1 OTA app 00 11 00400000 003f0000
I (82) boot: 4 storage Unknown data 01 83 007f0000 00800000
I (88) boot: 5 coredump Unknown data 01 03 00ff0000 00010000
I (95) boot: End of partition table
I (98) esp_image: segment 0: paddr=00010020 vaddr=3c0d0020 size=38e24h (232996) map
I (148) esp_image: segment 1: paddr=00048e4c vaddr=3fc98100 size=04b3ch ( 19260) load
I (152) esp_image: segment 2: paddr=0004d990 vaddr=40374000 size=02688h ( 9864) load
I (154) esp_image: segment 3: paddr=00050020 vaddr=42000020 size=cbde8h (835048) map
I (309) esp_image: segment 4: paddr=0011be10 vaddr=40376688 size=11a60h ( 72288) load
I (325) esp_image: segment 5: paddr=0012d878 vaddr=50000000 size=00024h ( 36) load
I (334) boot: Loaded app from partition at offset 0x10000
I (334) boot: Disabling RNG early entropy source...
I (344) cpu_start: Multicore app
I (352) cpu_start: GPIO 44 and 43 are used as console UART I/O pins
I (353) cpu_start: Pro cpu start user code
I (353) cpu_start: cpu freq: 160000000 Hz
I (355) app_init: Application information:
I (359) app_init: Project name: esp-project
I (363) app_init: App version: 1
I (366) app_init: Compile time: Jun 23 2026 16:51:45
I (371) app_init: ELF file SHA256: 318171f59...
I (376) app_init: ESP-IDF: v6.0
I (379) efuse_init: Min chip rev: v0.0
I (383) efuse_init: Max chip rev: v0.99
I (387) efuse_init: Chip rev: v0.2
I (391) heap_init: Initializing. RAM available for dynamic allocation:
I (397) heap_init: At 3FCA7CB0 len 00041A60 (262 KiB): RAM
I (402) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (407) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (413) heap_init: At 600FE000 len 00001FE8 (7 KiB): RTCRAM
I (419) spi_flash: detected chip: boya
I (421) spi_flash: flash io: dio
I (425) sleep_gpio: Configure to isolate all GPIO pins in sleep state
I (431) sleep_gpio: Enable automatic switching of GPIO sleep configuration
I (0) main_task: Started on CPU1
I (40) main_task: Calling app_main()
I am using ESP-IDF on an open source version of VSCode on Linux. In sdkconfing I've basically only changed the partition to my custom csv file and changed the flasher config to DIO, 40 MHz, 16 MB.
I've poured hours on finding how to make it work on the two cores so that i can isolate some tasks (mainly WiFi on one and the app on the other core). I've tried putting it in a separate task and pinning it to one of the cores. I've also played with priority and affinity settings in the sdkconfig but nothing worked. Should I just give up on multicore and run everything on a single one?
