搜索
查看: 3386|回复: 6

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

[复制链接]

该用户从未签到

29

主题

88

帖子

0

蝴蝶豆

金牌会员

最后登录
2019-10-15
发表于 2017-4-6 16:49:19 | 显示全部楼层 |阅读模式
__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中出现大量的错误,上面标红的地方,还有很多函数,这是为什么?
回复

使用道具 举报

该用户从未签到

76

主题

759

帖子

17

蝴蝶豆

论坛元老

最后登录
2022-5-20
发表于 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. }
复制代码



回复 支持 反对

使用道具 举报

该用户从未签到

29

主题

88

帖子

0

蝴蝶豆

金牌会员

最后登录
2019-10-15
 楼主| 发表于 2017-4-6 17:16:58 | 显示全部楼层
我这个已经在kell平台上移植成功了,然后我想转到IAR中,然后就不好使了,我想知道是不是在IAR中还需要配置一些东西呢?
回复 支持 反对

使用道具 举报

该用户从未签到

64

主题

1138

帖子

140

蝴蝶豆

论坛元老

最后登录
2020-12-3
发表于 2017-4-6 18:00:25 | 显示全部楼层
月霜寒 发表于 2017-4-6 17:16
我这个已经在kell平台上移植成功了,然后我想转到IAR中,然后就不好使了,我想知道是不是在IAR中还需要配置 ...

port应该需要对应的平台的文件,可以下载FreeRTOS的源码替换成IAR平台下的port文件试试
回复 支持 反对

使用道具 举报

该用户从未签到

29

主题

88

帖子

0

蝴蝶豆

金牌会员

最后登录
2019-10-15
 楼主| 发表于 2017-4-7 08:32:42 | 显示全部楼层
我试试
回复

使用道具 举报

该用户从未签到

0

主题

1

帖子

0

蝴蝶豆

初级会员

最后登录
2020-4-29
发表于 2020-4-29 13:51:58 | 显示全部楼层
回复 支持 反对

使用道具 举报

该用户从未签到

7

主题

126

帖子

80

蝴蝶豆

金牌会员

最后登录
2021-4-6
发表于 2020-4-29 13:59:10 | 显示全部楼层
keil、iar和gcc各自的汇编格式不一致,不能共用
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|论坛-意法半导体STM32/STM8技术社区

GMT+8, 2024-4-29 18:46 , Processed in 1.184439 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表