IAR7版本出现Warning

在使用新版的IAR时,以前的工程总少不了一堆的错误:

一.  在使用IAR7.1及以上版本时出现诸多警告形如:Warning[25]: Label'Reset_Handler' is defined pubweak in a section implicitly declared root,则将SECTION.text:CODE:REORDER(1)改为SECTION .text:CODE:REORDER:NOROOT(1)即可。详情如下:

7.1版本之前,section默认是noroot,但现在是root。所以可以将SECTION .text:CODE:REORDER(1)改成SECTION .text:CODE:REORDER:NOROOT(1)或SECTION .text:CODE:REORDER:ROOT(1)。注意 NOROOT和 ROOT 的区别,NOROOT表示如果符号没有被关联的时候是被优化掉的,如果想不被优化则使用ROOT。

以下为IAR手册的说明:

Problem

After upgrading to EWARM 7.10.1 the Warning[25] is issued during assembly of afile that assembled without warning on earlier version of EWARM.

Background

The assembler (iasmarm) is (from EWARM 7.10.1) issuing Warning[25] for adeprecated assembler construction.

The deprecated assembler source construction looks like this:

      PUBWEAK NMI_Handler
      SECTION .text:CODE:REORDER(1)
  NMI_Handler
Solution

To avoid the warning, add ":NOROOT" to the "SECTION"statement:

      PUBWEAK NMI_Handler
      SECTION .text:CODE:REORDER:NOROOT(1)
  NMI_Handle

二.Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned long __REV16(unsigned long)" (declared at line 177 of "C:\ E:\STM32资料\源码\36 以太网STM32F107_ETH_LCD(神舟IV号)TFTP文件传输\Libraries\CMSIS\Core\CM3\core_cm3.h 710 

错误的原因是因为新版本CMSIS的intrinsics.h等文件与之前的版本不兼容。

解决办法:

1: Project options > General Options > Library 
Configuration 里选择 USE CMSIS ;

2:在Project>Options>C/C++Compiler>Preprocessor里删除所有的 CMSIS header files ,
“$PROJ_DIR$\..\..\..\Libraries\CMSIS\CM3\CoreSupport” 。
再次编译,通过。。。。。

永不止步步 发表于09-30 14:53 浏览65535次
分享到:

已有0条评论

暂时还没有回复哟,快来抢沙发吧

添加一条新评论

只有登录用户才能评论,请先登录注册哦!

话题作者

永不止步步
金币:67417个|学分:345791个
立即注册
畅学电子网,带你进入电子开发学习世界
专业电子工程技术学习交流社区,加入畅学一起充电加油吧!

x

畅学电子网订阅号