ESP32S3 - Enabling CONFIG_FREERTOS_USE_TICK_HOOK causes nvs_flash_init() to panic
Posted: Mon May 08, 2023 10:41 pm
I've run into a rather perplexing issue. I've been developing an app on an ESP32-S3 in C and C++, using SPI and I2C and other facilities, all working fine. I then folded in code to run the Wi-Fi interface, based on the simple "station" example in IDF v5.0.1. Unfortunately, I found that my app would immediately panic at startup. I traced the panic to nvs_flash_init(); the message is:
Well, great. Question is, what's causing it? I found I could run the "station" example by itself, and it would run fine. After figuring out I could copy over all my SDK settings without any code from my custom project and make the example crash, I worked by process of elimination and determined that turning on CONFIG_FREERTOS_USE_TICK_HOOK would cause my app to crash when nvs_flash_init() is called. If I disable that option, my app works fine. Yes, I added void vApplicationTickHook(void) { } to my app.
I've attached my demo project. The sdkconfig.defaults as provided should result in a working app. Then delete sdkconfig, uncomment the option, and rebuild, and you should see the core panic. Can someone explain why adding the tick hook causes a core panic when initializing NVS? I kinda want to use the tick hook facility to run my own tick timer. Unless someone has a different way of attaching to the SysTick timer while running FreeRTOS...
Dana M.
Code: Select all
Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached memory region accessed).
Core 0 register dump:
PC : 0x42070e12 PS : 0x00060034 A0 : 0x8037cea6 A1 : 0x3fc98870
A2 : 0x00000001 A3 : 0x3fc9ab84 A4 : 0x004c0000 A5 : 0x00070000
A6 : 0x00000000 A7 : 0x3fc9b070 A8 : 0x8037e6ce A9 : 0x3fc98850
A10 : 0x3fc9ab20 A11 : 0x3fc9ab20 A12 : 0x00060021 A13 : 0x00060023
A14 : 0x00000000 A15 : 0x0000cdcd SAR : 0x0000000f EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0xffffffff
Backtrace: <lots of backtrace hex>
I've attached my demo project. The sdkconfig.defaults as provided should result in a working app. Then delete sdkconfig, uncomment the option, and rebuild, and you should see the core panic. Can someone explain why adding the tick hook causes a core panic when initializing NVS? I kinda want to use the tick hook facility to run my own tick timer. Unless someone has a different way of attaching to the SysTick timer while running FreeRTOS...
Dana M.