NVIC_INT_CTRL EQU 0xE000ED04 ; Interrupt control state register NVIC_SYSPRI2 EQU 0xE000ED20 ; System priority register (2) NVIC_PENDSV_PRI EQU 0xFFFF0000 ; PendSV and system tick priority(Both are lowest,0xff) NVIC_PENDSVSET EQU 0x10000000 ; Value to trigger PendSV exception 触发软件中断的值
OSStartHighRdy
LDR R4, =NVIC_SYSPRI2 ; set the PendSV exception priority 设置PendSV优先级 LDR R5, =NVIC_PENDSV_PRI STR R5, [R4]
MOV R4, #0 ; set the PSP to 0 for initial context switch call 使PSP等于0 MSR PSP, R4