commit 75f1217fef297c5bb15e2c05ed402aa47b361a5e
parent 64b02334e127bd21ed2ba66eb50625a5c00e7ee8
Author: Matsuda Kenji <info@mtkn.jp>
Date: Mon, 10 Apr 2023 12:05:16 +0900
worked.
maybe literals are out of copied area
Diffstat:
M | mach.s | | | 31 | ++++++++++++++++++------------- |
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/mach.s b/mach.s
@@ -9,17 +9,14 @@ vectors:
.section .text, "ax"
.thumb_func
reset:
- ldr r0, sram_base
- ldr r0, [r0, #0]
+ ldr r0, init_sp
mov sp, r0
- ldr r2, =(xip_base + 0x200)
- ldr r3, =(sram_base + 0x100)
- //ldr r1, etext
- //sub r1, r1, r3
- //add r1, r1, #2
- nop
- nop
+ ldr r2, xip_copy_base
+ ldr r3, sram_copy_base
+ ldr r0, etext
+ sub r0, r0, r3
+ add r0, r0, #2
ldr r0, =0x300
sram_cpy:
ldr r1, [r2, #0]
@@ -28,12 +25,22 @@ sram_cpy:
add r3, r3, #0x4
sub r0, r0, #0x4
bne sram_cpy
-
bl main
-
hang:
b hang
+ .align 2
+xip_copy_base:
+ .word 0x10000200
+sram_copy_base:
+ .word 0x20000100
+init_sp:
+ .word 0x20040000
+etext:
+ .word _etext
+.ltorg
+
+
.global init
.thumb_func
init:
@@ -361,5 +368,3 @@ rosc_base:
sio_base:
.word 0xd0000000
-etext:
- .word _etext