context_gcc.s:110: Error: thumb conditional instruction should be in IT block `vstmdbeq r1!,{d8-d15}

RT-Thread 移植过程中,编译 libcpu/arm/cortex-m4/context_gcc.s (RT-Thread 启动文件)时出现如下错误:
rt-thread/libcpu/arm/cortex-m4/context_gcc.s:110: Error: thumb conditional instruction should be in IT block – vstmdbeq r1!,{d8-d15}' rt-thread/libcpu/arm/cortex-m4/context_gcc.s:119: Error: thumb conditional instruction should be in IT block -- moveq r4,#0x01’
rt-thread/libcpu/arm/cortex-m4/context_gcc.s:140: Error: thumb conditional instruction should be in IT block – `vldmiane r1!,{d8-d15}’

/opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F429xx -DHAVE_CCONFIG_H -DRT_USING_MINILIBC -DRT_USING_NEWLIB -Iboard -ICORE -IHALLIB/Inc -IHALLIB/Inc/Legacy -Ihardware/CAN -Ihardware/KEY -Ihardware/LCD -Ihardware/LED -Ihardware/SDRAM -Irt-thread/components/finsh -Irt-thread/include -Irt-thread/include/libc -ISYSTEM/delay -ISYSTEM/sys -ISYSTEM/usart -IUSER  -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/context_gcc.d" rt-thread/libcpu/arm/cortex-m4/context_gcc.s -o build/context_gcc.o
rt-thread/libcpu/arm/cortex-m4/context_gcc.s: Assembler messages:
rt-thread/libcpu/arm/cortex-m4/context_gcc.s:110: Error: thumb conditional instruction should be in IT block -- `vstmdbeq r1!,{d8-d15}'
rt-thread/libcpu/arm/cortex-m4/context_gcc.s:119: Error: thumb conditional instruction should be in IT block -- `moveq r4,#0x01'
rt-thread/libcpu/arm/cortex-m4/context_gcc.s:140: Error: thumb conditional instruction should be in IT block -- `vldmiane r1!,{d8-d15}'
rt-thread/libcpu/arm/cortex-m4/context_gcc.s:148: Error: thumb conditional instruction should be in IT block -- `bicne lr,lr,#0x10'
make: *** [Makefile:180:build/context_gcc.o] 错误 1

在这里插入图片描述
主要原因是编译参数的问题,在makefile中进行修改即可解决。
错误

FLOAT-ABI = -mfloat-abi=hard
#FLOAT-ABI = -mfloat-abi=softfp
 #FLOAT-ABI = -mfloat-abi=soft

正确

#FLOAT-ABI = -mfloat-abi=hard
#FLOAT-ABI = -mfloat-abi=softfp
FLOAT-ABI = -mfloat-abi=soft

错误
正确

然后进行编译

在这里插入图片描述

编译成功。

网上说float-abi是关于CPU浮点计算的编译参数,但是我记得M4是支持浮点的,使用了 ‘hard’和’softfp’两种参数都提示错误,最后换成 'soft’或者直接去掉这个参数可以编译成功,应该不加 ‘-mfload-abi=arg’这个参数默认值就是’soft’吧,在网上查了一圈,没有查到相关结果。网上的说法是,soft是软、硬浮点编译的一个中间值。'hard’和’softfp’是纯硬件和纯软件编译。

后面发现还有第二种解决办法,不需要修改float-abi参数。需要在编译时增加一个参数,
ASFLAGS += -Wa,-mimplicit-it=thumb
CFLAGS += -Wa,-mimplicit-it=thumb

在这里插入图片描述

  • 8
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值