|
使用STM32F429,按照pdf教程修改fpu部分,下载源码使用的V3.04)

为了验证是否我改错了,再次下载了STM32F7的官网example(其使用的V3.05)
发现在下面加入pdf中的语句,并不正常工作(PDF中相关部分均已修改过)
OS_CPU_PendSVHandler
CPSID I ; Prevent interruption during context switch
MRS R0, PSP ; PSP is process stack pointer
STMFD R0!, {R4-R11} ; Save remaining regs r4-11 on process stack
MOV32 R5, OSTCBCurPtr ; OSTCBCurPtr->OSTCBStkPtr = SP;
LDR R6, [R5]
STR R0, [R6] ; R0 is SP of process being switched out
; At this point, entire context of process has been saved
MOV R4, LR ; Save LR exc_return value
BL OSTaskSwHook ; OSTaskSwHook();
MOV32 R0, OSPrioCur ; OSPrioCur = OSPrioHighRdy;
MOV32 R1, OSPrioHighRdy
LDRB R2, [R1]
STRB R2, [R0]
MOV32 R1, OSTCBHighRdyPtr ; OSTCBCurPtr = OSTCBHighRdyPtr;
LDR R2, [R1]
STR R2, [R5]
ORR LR, R4, #0xF4 ; Ensure exception return uses process stack
LDR R0, [R2] ; R0 is new process SP; SP = OSTCBHighRdyPtr->StkPtr;
LDMFD R0!, {R4-R11} ; Restore r4-11 from new process stack
MSR PSP, R0 ; Load PSP with new process SP
CPSIE I
BX LR ; Exception return will restore remaining context
END
版主可以自己试一试,看看新版本的修改是否正常,谢谢 |
|