Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread一般讨论
硬件bug无处不在,M7内核r0p1版本的bug
发布于 2019-05-03 10:51:14 浏览:2463
订阅该版
此文转载与armfly论坛,原帖地址:[http://forum.armfly.com/forum.php?mod=viewthread&tid=93546&page=1&extra=#pid160632](http://forum.armfly.com/forum.php?mod=viewthread&tid=93546&page=1&extra=#pid160632) FreeRTOS: There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. The best option depends on the revision of the ARM Cortex-M7 core in use. The revision is specified by an 'r' number, and a 'p' number, so will look something like 'r0p1'. Check the documentation for the microcontroller in use to find the revision of the Cortex-M7 core used in that microcontroller. If in doubt, use the FreeRTOS port provided specifically for r0p1 revisions, as that can be used with all core revisions. The first option is to use the ARM Cortex-M4F port, and the second option is to use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in the /FreeRTOS/Source/portable/RVDS/ARM_CM4F directory. If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/RVDS/ARM_CM7/r0p1 directory. 意思是说对于r0p1版本的bug,有一个专门的移植文件(有一个微小的修正),当然,这个文件可以用于所有M7内核,含已经解决此bug的高版本内核。 对于高版本M7内核,推荐使用M4F里面的移植文件。
查看更多
2
个回答
默认排序
按发布时间排序
whj467467222
认证专家
2019-05-03
开源,分享,交流,共同进步
[table] [tr][td]uCOS: ;******************************************************************************************************** ; HANDLE PendSV EXCEPTION ; void OS_CPU_PendSVHandler(void) ; ; Note(s) : 1) PendSV is used to cause a context switch. This is a recommended method for performing ; context switches with Cortex-M. This is because the Cortex-M auto-saves half of the ; processor context on any exception, and restores same on return from exception. So only ; saving of R4-R11 & R14 is required and fixing up the stack pointers. Using the PendSV exception ; this way means that context saving and restoring is identical whether it is initiated from ; a thread or occurs due to an interrupt or exception. ; ; 2) Pseudo-code is: ; a) Get the process SP ; b) Save remaining regs r4-r11 & r14 on process stack; ; c) Save the process SP in its TCB, OSTCBCurPtr->OSTCBStkPtr = SP; ; d) Call OSTaskSwHook(); ; e) Get current high priority, OSPrioCur = OSPrioHighRdy; ; f) Get current ready thread TCB, OSTCBCurPtr = OSTCBHighRdyPtr; ; g) Get new process SP from TCB, SP = OSTCBHighRdyPtr->OSTCBStkPtr; ; h) Restore R4-R11 and R14 from new process stack; ; i) Perform exception return which will restore remaining context. ; ; 3) On entry into PendSV handler: ; a) The following have been saved on the process stack (by processor): ; xPSR, PC, LR, R12, R0-R3 ; b) Processor mode is switched to Handler mode (from Thread mode) ; c) Stack is Main stack (switched from Process stack) ; d) OSTCBCurPtr points to the OS_TCB of the task to suspend ; OSTCBHighRdyPtr points to the OS_TCB of the task to resume ; ; 4) Since PendSV is set to lowest priority in the system (by OSStartHighRdy() above), we ; know that it will only be run when no other exception or interrupt is active, and ; therefore safe to assume that context being switched out was using the process stack (PSP). ; ; 5) Increasing priority using a write to BASEPRI does not take effect immediately. ; (a) IMPLICATION This erratum means that the instruction after an MSR to boost BASEPRI ; might incorrectly be preempted by an insufficient high priority exception. ; ; (b) WORKAROUND The MSR to boost BASEPRI can be replaced by the following code sequence: ; ; CPSID i ; MSR to BASEPRI ; DSB ; ISB ; CPSIE i ;******************************************************************************************************** OS_CPU_PendSVHandler CPSID I ; Cortex-M7 errata notice. See Note #5 MOV32 R2, OS_KA_BASEPRI_Boundary ; Set BASEPRI priority level required for exception preemption LDR R1, [R2] MSR BASEPRI, R1 DSB ISB CPSIE I[/td][/tr] [/table]
aozima
2019-05-05
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
关注
撰写答案
登录
注册新账号
关注者
0
被浏览
2.5k
关于作者
whj467467222
开源,分享,交流,共同进步
提问
29
回答
1222
被采纳
149
关注TA
发私信
相关问题
1
有关动态模块加载的一篇论文
2
最近的调程序总结
3
晕掉了,这么久都不见layer2的踪影啊
4
继续K9ii的历程
5
[GUI相关] FreeType 2
6
[GUI相关]嵌入式系统中文输入法的设计
7
20081101 RT-Thread开发者聚会总结
8
嵌入式系统基础
9
linux2.4.19在at91rm9200 上的寄存器设置
10
[转]基于嵌入式Linux的通用触摸屏校准程序
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
RT-Thread项目助手v0.2.0 - 支持Env Windows
2
RttreadV5.10上,GD32F450Z RTC时间显示问题
3
rt-smart启动流程分析
4
EtherKit快速上手PROFINET
5
RTThread USB转串口无法接收数据
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
cubemx
flash
freemodbus
BSP
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
flashDB
GD32
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1444
个答案
290
次被采纳
张世争
813
个答案
177
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
149
次被采纳
本月文章贡献
出出啊
1
篇文章
2
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
3
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部