Commit a7b9cb9
Merge #168
168: On HardFault entry use MSP/PSP depending on stack mode r=thejpster a=bytex64
Noticed this when making my own hardfault handler - none of the registers were correct. The `&ExceptionFrame` argument was wrong because I was using the PSP in Thread mode, but the handler only loads MSP. This PR inspects the EXC_RETURN value in LR and loads either MSP or PSP depending on the stack used (see section B1.5.8 in the ARMv7-M architecture manual for details on the format of EXC_RETURN).
I haven't tested this on armv6m or armv8m, but I believe it works the same across the board. Also didn't update the libraries in `bin/` since I wasn't sure if that was expected or not.
Co-authored-by: Chip <[email protected]>File tree
6 files changed
+9
-0
lines changed- cortex-m-rt
- bin
6 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments