diff --git a/firmware/target/arm/system-arm.c b/firmware/target/arm/system-arm.c index 5c5a18c..2533249 100644 --- a/firmware/target/arm/system-arm.c +++ b/firmware/target/arm/system-arm.c @@ -46,6 +46,24 @@ void __attribute__((noreturn)) UIE(unsigned int pc, unsigned int num) snprintf(str, sizeof(str), "at %08x" IF_COP(" (%d)"), pc IF_COP(, CURRENT_CORE)); lcd_puts(0, 1, str); + + if(num == 2) /* data abort */ + { + register unsigned status, address; + + asm volatile( + "mrc p15, 0, %0, c5, c0 \n" /* fault status register (FSR) */ + "mrc p15, 0, %1, c6, c0 \n" /* fault address register (FAR) */ + : "=r"(status), "=r"(address) ); + + snprintf(str, sizeof(str), "address 0x%8x", address); + lcd_puts(0, 3, str); + + snprintf(str, sizeof(str), "domain %d, fault %d", + (status >> 4) & 0xf, status & 0xf); + lcd_puts(0, 4, str); + } + lcd_update(); disable_interrupt(IRQ_FIQ_STATUS);