esp32: Core dump sanity checks were added

- CRC for core dump flash partition config
 - Tasks with corrupted TCBs are skipped
 - Assertions to check that nothing is written beyond core dump flash partition
This commit is contained in:
Alexey Gerenkov
2017-04-20 19:38:38 +03:00
parent 90c8bd93e0
commit 98895af68b
3 changed files with 159 additions and 68 deletions

View File

@@ -347,11 +347,6 @@ static void esp_panic_dig_reset()
}
}
static inline bool stackPointerIsSane(uint32_t sp)
{
return !(sp < 0x3ffae010 || sp > 0x3ffffff0 || ((sp & 0xf) != 0));
}
static void putEntry(uint32_t pc, uint32_t sp)
{
if (pc & 0x80000000) {
@@ -372,7 +367,7 @@ static void doBacktrace(XtExcFrame *frame)
pc = frame->a0;
while (i++ < 100) {
uint32_t psp = sp;
if (!stackPointerIsSane(sp) || i++ > 100) {
if (!esp_stack_ptr_is_sane(sp) || i++ > 100) {
break;
}
sp = *((uint32_t *) (sp - 0x10 + 4));