找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 8822|回复: 0
打印 上一主题 下一主题
收起左侧

IAR for ARM "Error[Pe147]" and "Error[Pe337]" solution

[复制链接]
跳转到指定楼层
楼主
ID:82083 发表于 2015-6-9 02:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
今天升级了一下IAR,发现之前编译通过的程序报了很多类似的错误:Error[Pe147]: declaration is incompatible with "__nounwind__interwork __softfp unsigned long __get_PSP(void)"
(declared at linexx\CMSIS\CM3\CoreSupport\core_cm3.h)
报错不约而同的指向了core_cm3.h这个文件。
百度了一下才知道:core_cm3.h文件太老了,与新版本的IAR6.5不兼容。
在IAR官网也找到了一篇描述相关问题的文章:
Problem
There is an issue with older versions of CMSIS and IAREmbedded Workbench for ARM (EWARM) version 6.20.1 and later. Thismay lead to build errors with CMSIS projects.
Theerrors are for example "Error[Pe147]" and "Error[Pe337]".Most ofthe errors comes from a CMSIS header file named core_cm3.h orsimilar.
紧接着也给出了具体办法:
Solutions
Solution 1
Copya CMSIS based project from the present version, and use thatproject as the base to where you application is added.
Solution 2
Seethe release notes for the C/C++ Compiler (link to the right):
http://supp.iar.com/FilesPublic/UPDINFO/005832/arm/doc/infocenter/iccarm.ENU.html
Seethe chapter "A special note on CMSIS integration", specially thepart that starts with "However, ...".

Please note that excluding the CMSIS files from the exampleprojects, some functions required by the examples may disappear. Insuch a situation, just changing the include paths and excludingsome source files is not enough to fix the problem. If so,functions has to be moved from excluded files (likesystem_stm32f10x.c) to the source in the project in order to buildit.
Background
Thecompiler that comes with EWARM 6.20.1 and later has got support formore intrinsics than previous versions, which leads to anincompatibility issue with CMSIS source code that is included inprojects.
Theessence of the adjustment suggested in the release notes is to"remove" the CMSIS source code included in the project and insteaduse the CMSIS source code that is installed in EWARM, in the"arm\CMSIS" directory. Turn on
CMSIS usage in"Project>Options...>GeneralOptions>LibraryConfiguration>Use CMSIS".
Note that some of the CMSISexample projects in EWARM 6.20.1were affectedby the problem discussed above. This has been corrected inlater versions.
查了一下,网上也有类似解决方案的:
1,把老的core_cm3.h去掉,删除,或者改成core_cm3.h.old。
2,Project -> Options -> General Options -> LibraryConfiguration -> Use CMSIS,右下角的选项中选择 use CMSIS。
然后默默把core_cm3.h改为了core_cm3.h.old,勾选useCMSIS
0errors,0warnings



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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