commit 2ba7851cb24ada3e4ab910f8822dcb7095b74252
parent 7223002cb9a28c1cc45943ea980d2367b840c544
Author: Matsuda Kenji <info@mtkn.jp>
Date: Tue, 19 Mar 2024 10:11:08 +0900
debug: rewriting the automatically saved registers causes hard fault at returning from the isr
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ex3/proc.s b/ex3/proc.s
@@ -111,7 +111,7 @@ isr_alarm:
bl switch_context // r0 is the r[17] of the next task.
add sp, sp, #(17*4)
add r2, sp, #4 // for the popped lr
-
+/*
ldr r1, [r0, #(0 * 4)] // r0
str r1, [r2, #0]
ldr r1, [r0, #(1 * 4)] // r1
@@ -128,6 +128,7 @@ isr_alarm:
str r1, [r2, #0x18]
ldr r1, [r0, #(16 * 4)] // xpsr
str r1, [r2, #0x1c]
+*/
mov r4, r0
ldr r0, =(1000 * 1000)
@@ -135,8 +136,8 @@ isr_alarm:
pop {r5}
- ldr r0, [r4, #(13 * 4)] // sp
- mov sp, r0
+// ldr r0, [r4, #(13 * 4)] // sp
+// mov sp, r0
bx r5