[arch][arm-m] print something more useful on usage faults

This commit is contained in:
Travis Geiselbrecht
2012-06-27 19:36:22 -07:00
parent c32135b7e5
commit 70c232d6a8

View File

@@ -48,6 +48,14 @@ static void hardfault(struct cm3_exception_frame *frame)
halt();
}
static void usagefault(struct cm3_exception_frame *frame)
{
printf("usagefault: ");
dump_frame(frame);
halt();
}
static void busfault(struct cm3_exception_frame *frame)
{
printf("busfault: ");
@@ -94,8 +102,13 @@ void _busfault(void)
void _usagefault(void)
{
printf("usagefault\n");
halt();
__asm__ volatile(
"push {r4-r11};"
"mov r0, sp;"
"b %0;"
:: "i" (usagefault)
);
__UNREACHABLE;
}
/* systick handler */