Commit 02a44b2
fw/kernel/core_dump: dump LCPU RAM last and only when its domain is up
Capturing LCPU RAM (the SF32LB52 BLE coprocessor RAM in the LPSYS
domain at 0x20400000) was added as the second memory region, ahead of
the extra-register and thread chunks. On real crashes the dump
consistently aborted right after that region: reads into the LPSYS
domain hang/fault when it is powered down, and because the region sat
before the registers and threads, every dump lost the data needed to
symbolize the crash. readcore.py then produced a register-less ELF and
GDB reported "Couldn't find general-purpose registers in core file".
Move the LCPU RAM dump to the very end, after the thread walk, mirroring
the existing "threads last in case FreeRTOS structures are corrupt"
design so a faulting read can no longer cost us the RAM, registers, and
threads. Also gate it on the HPSYS AON ISSR LP_ACTIVE bit, which the HAL
already uses to decide whether LPSYS registers are reachable, so we skip
the region entirely when the domain is off instead of hanging on it.
The Memfault upload path is unaffected: it only caches addresses within
the main SRAM dump range, so the lcpu_ram extra region was already
dropped there regardless.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>1 parent d437284 commit 02a44b2
1 file changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 109 | | |
113 | 110 | | |
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
442 | 446 | | |
443 | 447 | | |
444 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
445 | 461 | | |
446 | 462 | | |
447 | 463 | | |
| |||
659 | 675 | | |
660 | 676 | | |
661 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
662 | 683 | | |
663 | 684 | | |
664 | 685 | | |
| |||
0 commit comments