X-Git-Url: https://git.wirehaze.ovh/stm32f411ceu6.git/blobdiff_plain/cef403c131fbb65f09837b0501b7e558e1462765..refs/heads/main:/sys/core/exceptions.c diff --git a/sys/core/exceptions.c b/sys/core/exceptions.c index 77e67d7..ad76fc9 100644 --- a/sys/core/exceptions.c +++ b/sys/core/exceptions.c @@ -2,6 +2,7 @@ #include #include #include +#include /* Initialize just enough to be able to handle a fault. */ __attribute__ ((noinline, used)) static void @@ -46,8 +47,17 @@ reset_handler (void) asm ("b kentry"); } +/* TODO write proper exception handlers, this is just a test */ +__attribute__ ((noreturn)) static void +fault_handler (void) +{ + panic ("Fault"); +} + __attribute__ ((section (".vector_table"), used)) static unsigned long const vector_table[] = { - (unsigned long) &_sram_end, - (unsigned long) reset_handler, + [0] = (unsigned long) &_sram_end, + [1] = (unsigned long) reset_handler, + [3] = (unsigned long) fault_handler, /* ??? */ + [6] = (unsigned long) fault_handler, };