32 lines
468 B
ArmAsm
32 lines
468 B
ArmAsm
.syntax unified
|
|
.cpu cortex-m0plus
|
|
.thumb
|
|
|
|
.global boot2_pre
|
|
|
|
.section .text.boot2_pre
|
|
.type boot2_pre, %function
|
|
boot2_pre:
|
|
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:
|
|
|
|
ldr r0, =_stack_top
|
|
msr msp, r0
|
|
bl boot2_copy_self
|
|
bl main
|
|
b .
|
|
|
|
.size .boot2_pre, .-boot2_pre
|