StoreProhibited triggered by FreeRTOS
Posted: Tue Apr 24, 2018 5:55 pm
I'm trying to port a firmware project to ESP32 and I'm having trouble in getting the 3 tasks correctly configured and working together.
Although the various parts all seem to work in isolation, when the whole thing comes together it triggers seemingly unrelated errors in FreeRTOS itself. I've looked at priorities, stack sizes, etc.. The underlying reason eludes me.
What does actually mean? Something has tried to write to an unallocated pointer?
Most of the errors follow this pattern:
And when I use EspStackTraceDecoder.jar to find the offending lines of code, it often shows an error within FreeRTOS like this:
I'm uncertain why this would happen when the tasks all run happily by themselves. It seems at times that the error is triggered by accessing one global error of memory by a task, when another task is running that doesn't access this memory.
I've noticed that core panics can be caused by a task locking up a core in an infinite loop, but this doesnt seem to be the case here, and I can't pinpoint whether it's to do with resources, memory protection, priorities..
I just tried to debug this particular crash ^^^ and openocd showed a very peculiar error:
All my tasks have priority 1. A task is being created where the priority is set by some random unzeroed memory? This must be within the SDK itself?
I know this is vague, but I don't see a way of making a minimal test case. Any clue would be helpful.
Although the various parts all seem to work in isolation, when the whole thing comes together it triggers seemingly unrelated errors in FreeRTOS itself. I've looked at priorities, stack sizes, etc.. The underlying reason eludes me.
What does
Code: Select all
Guru Meditation Error: Core 0 panic'ed (StoreProhibited)
Most of the errors follow this pattern:
Code: Select all
Guru Meditation Error: Core 0 panic'ed (StoreProhibited)
. Exception was unhandled.
Core 0 register dump:
PC : 0x4008cf79 PS : 0x00060033 A0 : 0x8008b9b8 A1 : 0x3ffb05a0
A2 : 0x3ffb3b48 A3 : 0x3ffcec90 A4 : 0x3ffbba7c A5 : 0x000000ff
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x3ffb7946 A9 : 0x00000000
A10 : 0x3ffcd1c0 A11 : 0x00000000 A12 : 0x00060021 A13 : 0x00000001
A14 : 0x00060021 A15 : 0x00060023 SAR : 0x00000011 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000004 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Core 0 was running in ISR context:
EPC1 : 0x4008cf79 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x4008a78a
Backtrace: 0x4008cf79:0x3ffb05a0 0x4008b9b5:0x3ffb05c0 0x4008a1a3:0x3ffb05e0 0x4008c525:0x3ffb0600 0x40082582:0x3ffb0610 0x400d374b:0x00000000
Code: Select all
Exception Cause: Not found
0x4008cf79: vListInsertEnd at /Users/tim/ESP/esp-idf/components/freertos/list.c:131
0x4008cf79: vListInsertEnd at /Users/tim/ESP/esp-idf/components/freertos/list.c:131
0x4008a78a: xQueueGiveMutexRecursive at /Users/tim/ESP/esp-idf/components/freertos/queue.c:2037
0x4008cf79: vListInsertEnd at /Users/tim/ESP/esp-idf/components/freertos/list.c:131
0x4008b9b5: xTaskIncrementTick at /Users/tim/ESP/esp-idf/components/freertos/tasks.c:4571
0x4008a1a3: xPortSysTickHandler at /Users/tim/ESP/esp-idf/components/freertos/port.c:406
0x4008c525: _frxt_timer_int at /Users/tim/ESP/esp-idf/components/freertos/portasm.S:303
0x40082582: _xt_lowint1 at /Users/tim/ESP/esp-idf/components/freertos/xtensa_vectors.S:1105
0x400d374b: esp_vApplicationIdleHook at /Users/tim/ESP/esp-idf/components/esp32/freertos_hooks.c:85
I've noticed that core panics can be caused by a task locking up a core in an infinite loop, but this doesnt seem to be the case here, and I can't pinpoint whether it's to do with resources, memory protection, priorities..
I just tried to debug this particular crash ^^^ and openocd showed a very peculiar error:
Code: Select all
esp32: target state: halted
Info : Target halted. PRO_CPU: PC=0x400D27D5 (active) APP_CPU: PC=0x40080F6F
Error: FreeRTOS maximum used priority is unreasonably big, not proceeding: 1061179556
I know this is vague, but I don't see a way of making a minimal test case. Any clue would be helpful.