esp-idf icon indicating copy to clipboard operation
esp-idf copied to clipboard

occasionally Core 1 panic'ed (IllegalInstruction) when calling nvs_flash_init() (IDFGH-15437)

Open AxelLin opened this issue 6 months ago • 0 comments

Answers checklist.

  • [x] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [x] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [x] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.4.1-849-g28980b62c9

Espressif SoC revision.

ESP32-D0WDR2-V3

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-WROOM32E-N8R2

Power Supply used.

USB

What is the expected behavior?

no panic during boot.

What is the actual behavior?

nvs_flash_init() occassionally causes panic

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 153911750, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:2, clock div:2 secure boot v2 enabled secure boot verification succeeded load:0x3fff00c0 len:0x25c load:0x40078000 len:0x4bf0 load:0x40080400 len:0xc7c --- 0x40080400: _init at ??:?

entry 0x4008057c I (662) cpu_start: Multicore app I (754) cpu_start: Pro cpu start user code I (754) cpu_start: cpu freq: 240000000 Hz I (754) app_init: Application information: I (754) app_init: Project name: myapp I (758) app_init: App version: 2.99.3 I (762) app_init: Compile time: Jun 6 2025 17:40:15 I (767) app_init: ELF file SHA256: 23a57edf5... I (771) app_init: ESP-IDF: v5.4.1-849-g28980b62c9 I (776) efuse_init: Min chip rev: v3.1 I (780) efuse_init: Max chip rev: v3.99 I (784) efuse_init: Chip rev: v3.1 I (788) heap_init: Initializing. RAM available for dynamic allocation: I (794) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (799) heap_init: At 3FFBC430 len 00023BD0 (142 KiB): DRAM I (805) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (810) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (816) heap_init: At 40099C88 len 00006378 (24 KiB): IRAM I (822) spi_flash: detected chip: generic I (825) spi_flash: flash io: dio W (828) flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure) I (837) nvs_sec_provider: NVS Encryption - Registering Flash encryption-based scheme... I (843) main_task: Started on CPU0 I (845) main_task: Calling app_main() Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled. Memory dump at 0x4011f980: 5091ef6e 683e9a63 854ad2bc --- 0x4011f980: find_entry_and_check_all_reset at /home/axel/esp/esp-idf/components/esp_system/task_wdt/task_wdt.c:127

Core 1 register dump: PC : 0x4011f984 PS : 0x00060433 A0 : 0x8011fdbe A1 : 0x3ffbfec0
--- 0x4011f984: find_entry_from_task_handle_and_check_all_reset at /home/axel/esp/esp-idf/components/esp_system/task_wdt/task_wdt.c:145

A2 : 0x3ffbffe0 A3 : 0x3ff5f080 A4 : 0x00000001 A5 : 0x3ffc0830
A6 : 0x00000003 A7 : 0x00060023 A8 : 0x8011fd6d A9 : 0x3ffbfe90
A10 : 0x3ffbffe0 A11 : 0x3ffbfed0 A12 : 0x8008c802 A13 : 0x00060423
A14 : 0x00000003 A15 : 0x0000abab SAR : 0x00000000 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4011f981:0x3ffbfec0 0x4011fdbb:0x3ffbff00 0x400d6e76:0x3ffbff20 0x4008d79b:0x3ffbff40 --- 0x4011f981: find_entry_and_check_all_reset at task_wdt.c:? --- 0x4011fdbb: idle_hook_cb at /home/axel/esp/esp-idf/components/esp_system/task_wdt/task_wdt.c:460 --- 0x400d6e76: esp_vApplicationIdleHook at /home/axel/esp/esp-idf/components/esp_system/freertos_hooks.c:46 (discriminator 1) --- 0x4008d79b: prvIdleTask at /home/axel/esp/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4341 (discriminator 1)

Core 0 register dump: PC : 0x4011f437 PS : 0x00060230 A0 : 0x8011f6b5 A1 : 0x3ffbebb0
--- 0x4011f437: esp_mmu_unmap at /home/axel/esp/esp-idf/components/esp_mm/esp_mmu_map.c:638 (discriminator 1)

A2 : 0x3f460000 A3 : 0x00001040 A4 : 0x00000000 A5 : 0x3ffbec04
A6 : 0x40099f84 A7 : 0x3ffbec00 A8 : 0x3f460028 A9 : 0x00000001
A10 : 0x00000001 A11 : 0x3ffb839c A12 : 0x00000000 A13 : 0x00000012
A14 : 0x00000001 A15 : 0x00010000 SAR : 0x00000010 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

Backtrace: 0x4011f434:0x3ffbebb0 0x4011f6b2:0x3ffbebe0 0x4011db96:0x3ffbec00 0x4012288f:0x3ffbec30 0x400dba95:0x3ffbeca0 0x401c2e33:0x3ffbecc0 0x40122913:0x3ffbece0 0x400dcc2d:0x3ffbed50 0x401cac57:0x3ffbf060 --- 0x4011f434: esp_mmu_unmap at /home/axel/esp/esp-idf/components/esp_mm/esp_mmu_map.c:638 --- 0x4011f6b2: spi_flash_munmap at /home/axel/esp/esp-idf/components/spi_flash/flash_mmap.c:242 --- 0x4011db96: esp_partition_munmap at /home/axel/esp/esp-idf/components/esp_partition/partition_target.c:182 --- (inlined by) esp_partition_read at /home/axel/esp/esp-idf/components/esp_partition/partition_target.c:56 --- 0x4012288f: nvs_flash_read_security_cfg at /home/axel/esp/esp-idf/components/nvs_flash/src/nvs_api.cpp:698 --- 0x400dba95: read_security_cfg_flash_enc at /home/axel/esp/esp-idf/components/nvs_sec_provider/nvs_sec_provider.c:46 --- (inlined by) read_security_cfg_flash_enc at /home/axel/esp/esp-idf/components/nvs_sec_provider/nvs_sec_provider.c:39 --- 0x401c2e33: nvs_flash_read_security_cfg_v2 at /home/axel/esp/esp-idf/components/nvs_flash/src/nvs_api.cpp:755 --- 0x40122913: nvs_flash_init at /home/axel/esp/esp-idf/components/nvs_flash/src/nvs_api.cpp:141 --- 0x400dcc2d: app_main at /home/axel/esp/esp-idf-dev/apps/myapp/main/myapp.c:1388 --- 0x401cac57: main_task at /home/axel/esp/esp-idf/components/freertos/app_startup.c:208

ELF file SHA256: 23a57edf5

Rebooting... ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

Steps to reproduce.

I have below settings: CONFIG_ESP_TASK_WDT_EN=y CONFIG_ESP_TASK_WDT_INIT=y CONFIG_ESP_TASK_WDT_PANIC=y CONFIG_ESP_TASK_WDT_TIMEOUT_S=16 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y

It's not easy to reproduce, but occasionally I notice this panic during boot when calling nvs_flash_init().

Debug Logs.


Diagnostic report archive.

No response

More Information.

No response

AxelLin avatar Jun 07 '25 01:06 AxelLin