Humility should point out if the processor is in a fault state
cbiffle opened this issue · 0 comments
When diagnosing a kernel panic, I noticed that the panic message was truncated. Long story short, it was truncated because the kernel ran out of stack while generating the panic message. Whee.
Humility's output was
$ humility -t sidecar-b tasks
humility: attached to 0483:3754:002600184D4B500E20373831 via ST-Link V3
humility tasks failed: kernel has panicked on boot: "panicked at 'assertion failed: `(left == right)`\n left: `"
It would be fantastic if Humility would also point out that the machine is wedged in a kernel hard fault. You can determine this from the bottom 9 bits of xPSR, which contain the current active exception number. It should be 0 basically all the time unless you manage to stop the processor during an ISR; in such cases, things like stack traces tend to be wrong, so it'd be nice to print a note.
But particularly if we're in a fault (which is, to a first approximation, interrupts less than 11), it would be nice to know that. We have existing fault diagnosis code in humility probe
that could be applied.