]> granicus.if.org Git - esp-idf/commit
abort handler: Fix abort stack trace when abort() called in ISR
authorAngus Gratton <angus@espressif.com>
Thu, 8 Jun 2017 05:21:03 +0000 (15:21 +1000)
committerAngus Gratton <gus@projectgus.com>
Tue, 13 Jun 2017 00:19:01 +0000 (10:19 +1000)
commit47e789f538d9daa98ad09987f8206b1516f8d369
tree07be48f1166061a27e7ecd80c54fc4fc7b0aaa49
parent82b8b1db1f2bf185a495253620e4b4a5aaac3ddb
abort handler: Fix abort stack trace when abort() called in ISR

Previously, this resulted in task stack frames turning up incorrectly in the backtrace, ie

Backtrace: 0x400d22a0:0x3ffb0fa0 0x40085a3c:0x3ffb0fc0 0x400f32c4:0x3ffb0fe0 0x40081965:0x3ffb1010
0x400d22a0: esp_vApplicationIdleHook at /home/esp/esp-idf/components/esp32/./freertos_hooks.c:
52
0x40085a3c: prvIdleTask at /home/esp/esp-idf/components/freertos/./tasks.c:4431
0x400f32c4: i2c_isr_handler_default at /home/esp/esp-idf/components/driver/./i2c.c:598
0x40081965: _xt_lowint1 at xtensa_vectors.o:?

Fix is to implement abort() via an unhandled exception rather than a breakpoint, I think
because of relative priority of exception types.

Another approach would be to assign a software-only INUM to abort()ing and defined a
PANIC_RSN_ABORTED, but this is more complex and interrupt numbers are more scarce than RAM!
components/esp32/panic.c