完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
__asm void xPortPendSVHandler( void )
{ extern uxCriticalNesting; extern pxCurrentTCB; extern vTaskSwitchContext; PRESERVE8 mrs r0, psp i*** /* Get the location of the current TCB. */ ldr r3, =pxCurrentTCB ldr r2, [r3] /* Is the task using the FPU context? If so, push high vfp registers. */ tst r14, #0x10 it eq vstmdbeq r0!, {s16-s31} /* Save the core registers. */ stmdb r0!, {r4-r11, r14} /* Save the new top of stack into the first member of the TCB. */ str r0, [r2] stmdb sp!, {r3} mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY msr basepri, r0 d*** i*** bl vTaskSwitchContext mov r0, #0 msr basepri, r0 ldmia sp!, {r3} /* The first item in pxCurrentTCB is the task top of stack. */ ldr r1, [r3] ldr r0, [r1] /* Pop the core registers. */ ldmia r0!, {r4-r11, r14} /* Is the task using the FPU context? If so, pop the high vfp registers too. */ tst r14, #0x10 it eq vldmiaeq r0!, {s16-s31} msr psp, r0 i*** #ifdef WORKAROUND_PMU_CM001 /* XMC4000 specific errata */ #if WORKAROUND_PMU_CM001 == 1 push { r14 } pop { pc } nop #endif #endif bx r14 } stmdb sp!, {r3} //请问这句保存r3为什么要用sp?而不是psp? |
|
相关推荐
5个回答
|
|
SP(R13)既可以是MSP也可以是PSP;那么在xPortPendSVHandler()中断服务函数中,无疑SP指代的是MSP(可参考M3权威指南第三章).
|
|
|
|
|
|
|
|
不懂!!帮顶!!
|
|
|
|
|
|
|
|
好的,多谢解答。
|
|
|
|
只有小组成员才能发言,加入小组>>
1237 浏览 0 评论
1379 浏览 1 评论
2828 浏览 5 评论
3116 浏览 9 评论
移植了freeRTOS到STMf103之后显示没有定义的原因?
3042 浏览 6 评论
1283浏览 1评论
如何知道嵌入式电子控制单元 (ECU) 中的RAM使用情况?
904浏览 1评论
888浏览 0评论
这个BSP包有基础的例程的,不懂的话,3284494788@qq.com我发给您吧
824浏览 0评论
1240浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-7-6 01:45 , Processed in 1.175126 second(s), Total 56, Slave 47 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191