aboutsummaryrefslogtreecommitdiffstats
path: root/src/fsm/hardfault.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/fsm/hardfault.s')
-rw-r--r--src/fsm/hardfault.s13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/fsm/hardfault.s b/src/fsm/hardfault.s
new file mode 100644
index 0000000..8570dcc
--- /dev/null
+++ b/src/fsm/hardfault.s
@@ -0,0 +1,13 @@
+.syntax unified
+.cpu cortex-m3
+.thumb
+
+.global HardFault_Handler
+.extern hard_fault_handler_c
+
+HardFault_Handler:
+ tst lr, #4
+ ite eq
+ mrseq r0, msp
+ mrsne r0, psp
+ b hard_fault_handler_c