We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 373e56f commit 79d1060Copy full SHA for 79d1060
.gdbinit
@@ -0,0 +1,2 @@
1
+target extended-remote :4242
2
+b hard_fault_handler_c
main.c
@@ -1485,3 +1485,22 @@ int main(void)
1485
chThdSleepMilliseconds(1000);
1486
}
1487
1488
+
1489
+/* The prototype shows it is a naked function - in effect this is just an
1490
+assembly function. */
1491
+void HardFault_Handler( void );
1492
1493
+void hard_fault_handler_c(uint32_t *sp) __attribute__( ( naked ) );;
1494
1495
+void HardFault_Handler(void)
1496
+{
1497
+ uint32_t* sp;
1498
+ //__asm volatile ("mrs %0, msp \n\t": "=r" (sp) );
1499
+ __asm volatile ("mrs %0, psp \n\t": "=r" (sp) );
1500
+ hard_fault_handler_c(sp);
1501
+}
1502
1503
+void hard_fault_handler_c(uint32_t* sp)
1504
1505
+ while (true) {}
1506
0 commit comments