你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

freertos移植到IARforstm32中,port.c文件出现大量错误

[复制链接]
月霜寒 提问时间:2017-4-6 16:49 /
__asm void vPortSVCHandler( void )
{
PRESERVE8
ldr r3, =pxCurrentTCB /* Restore the context. */
ldr r1, [r3]   /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */
ldr r0, [r1]   /* The first item in pxCurrentTCB is the task top of stack. */
ldmia r0!, {r4-r11}  /* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */
msr psp, r0    /* Restore the task stack pointer. */
isb
mov r0, #0
msr basepri, r0
orr r14, #0xd
bx r14
}
这是我将freertos移植到stm32上,开发平台是IAR,在port.c中出现大量的错误,上面标红的地方,还有很多函数,这是为什么?
收藏 1 评论6 发布时间:2017-4-6 16:49

举报

6个回答
any012 回答时间:2017-4-6 17:12:19
不懂这个。
我是用cubemx生成的ac6下的freertos工程,据说是删减版的。
我找到了对应的函数,供参考:
  1. void vPortSVCHandler( void )
  2. {
  3.         __asm volatile (
  4.                                         "        ldr        r3, pxCurrentTCBConst2                \n" /* Restore the context. */
  5.                                         "        ldr r1, [r3]                                        \n" /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */
  6.                                         "        ldr r0, [r1]                                        \n" /* The first item in pxCurrentTCB is the task top of stack. */
  7.                                         "        ldmia r0!, {r4-r11}                                \n" /* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */
  8.                                         "        msr psp, r0                                                \n" /* Restore the task stack pointer. */
  9.                                         "        isb                                                                \n"
  10.                                         "        mov r0, #0                                                 \n"
  11.                                         "        msr        basepri, r0                                        \n"
  12.                                         "        orr r14, #0xd                                        \n"
  13.                                         "        bx r14                                                        \n"
  14.                                         "                                                                        \n"
  15.                                         "        .align 2                                                \n"
  16.                                         "pxCurrentTCBConst2: .word pxCurrentTCB                                \n"
  17.                                 );
  18. }
复制代码



月霜寒 回答时间:2017-4-6 17:16:58
我这个已经在kell平台上移植成功了,然后我想转到IAR中,然后就不好使了,我想知道是不是在IAR中还需要配置一些东西呢?
黑皮男 回答时间:2017-4-6 18:00:25
月霜寒 发表于 2017-4-6 17:16
我这个已经在kell平台上移植成功了,然后我想转到IAR中,然后就不好使了,我想知道是不是在IAR中还需要配置 ...

port应该需要对应的平台的文件,可以下载FreeRTOS的源码替换成IAR平台下的port文件试试
月霜寒 回答时间:2017-4-7 08:32:42
我试试
烈日1234 回答时间:2020-4-29 13:51:58
Dandjinh 回答时间:2020-4-29 13:59:10
keil、iar和gcc各自的汇编格式不一致,不能共用

所属标签

相似问题

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版