rp2040/example/boot2/boot2_pre.S

32 lines
468 B
ArmAsm
Raw Normal View History

2025-04-13 17:29:34 +08:00
.syntax unified
.cpu cortex-m0plus
.thumb
.global boot2_pre
.section .text.boot2_pre
.type boot2_pre, %function
boot2_pre:
2025-04-21 21:34:34 +08:00
cpsid i
/* clear bss section */
ldr r0, =0
ldr r1, =_bss_start
ldr r2, =_bss_end
cmp r1, r2
bhs 2f
1:
str r0, [r1]
adds r1, r1, #4
cmp r1, r2
blo 1b
2:
2025-04-13 21:33:56 +08:00
ldr r0, =_stack_top
msr msp, r0
bl boot2_copy_self
bl main
2025-04-19 21:07:29 +08:00
b .
2025-04-13 17:29:34 +08:00
.size .boot2_pre, .-boot2_pre