在线时间65 小时
UID3121733
注册时间2015-5-14
NXP金币3
该用户从未签到
中级会员
- 积分
- 418
- 最后登录
- 2024-3-22
|
楼主 |
发表于 2018-9-11 18:09:22
|
显示全部楼层
本帖最后由 czp111 于 2018-9-11 18:25 编辑
调试了一下,好像问题集中在创建任务这一块,mqx的系统下“sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, TCPECHO_STACKSIZE, TCPECHO_PRIORITY);
OSA_Start();”可以正常运行, OSA_Start()可以启动任务,结束后继续执行接下来的程序,freertos系统下, OSA_Start()无法成功启动任务,程序在OSA_Start()中出不来,即使tcpecho_thread线程中的程序全部注释,也创建不成功。
跟踪了ksdk2.0的任务创建函数,运行到函数“vPortStartFirstTask()”后出不来,而这段函数在底层是汇编的一段代码,程序一直运行到SVC 0 之后,是不是和地址“0xE000ED08”有关?:
vPortStartFirstTask
/* Use the NVIC offset register to locate the stack. */
ldr r0, =0xE000ED08
ldr r0, [r0]
ldr r0, [r0]
/* Set the msp back to the start of the stack. */
msr msp, r0
/* Call SVC to start the first task. */
cpsie i
cpsie f
dsb
isb
svc 0
|
|