arm: fatal: log which IRQn is triggering on spurious IRQs
LOG which IRQn line is triggering on spurious IRQs as this makes it much easier to debug spurious IRQs. The new logs with this patch looks like: <err> os: Unhandled IRQn: 227 <err> os: >>> ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0 <err> os: Current thread: 0x20032c20 (unknown) <err> os: Halting system Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
a58a7d0aa1
commit
850cd54e67
1 changed files with 10 additions and 0 deletions
|
|
@ -73,6 +73,16 @@ void z_arm_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
|||
esf_dump(esf);
|
||||
}
|
||||
#endif /* CONFIG_EXCEPTION_DEBUG */
|
||||
|
||||
/* LOG the IRQn that was unhandled */
|
||||
#if defined(CONFIG_CPU_CORTEX_M)
|
||||
if (reason == K_ERR_SPURIOUS_IRQ) {
|
||||
uint32_t irqn = __get_IPSR() - 16;
|
||||
|
||||
LOG_ERR("Unhandled IRQn: %d", irqn);
|
||||
}
|
||||
#endif
|
||||
|
||||
z_fatal_error(reason, esf);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue