新闻中心

EEPW首页>嵌入式系统>设计应用> IAR编译常见错误

IAR编译常见错误

作者: 时间:2016-11-28 来源:网络 收藏
Error[Cp001]: Copy protection check, No valid license found for this prod t [20]

原因:安装的时候没有把注册机的0x.....字串的小写字母改为大写字母。

本文引用地址://m.amcfsurvey.com/article/201611/322906.htm

Warning[Pe001]: last line of file ends without a newline F:emoTionIARPK升级CC1110-8main.c

原因:在使用IAR时常常会弹出类似这样一个警告,其实只要在最后一行多加一个回车就不会再有这个警告了.

Error[e72]: Segment BANK_RELAYS must be defined in a segment definition option (-Z, -b or -P)

原因:这是用730B编译的错误,可能是由于相对于目标工程版本过高的,后改用720H,没有发生错误。

Error[Pe005]: could not open source file "stdio.h"

原因:头文件路径不对造成,改正的方法是在设置选项卡的C/C++ Compiler -> Preprocessor选项里,将$TOOLKIT_DIR$INCCLIB添到Incl? paths中。

Error[Pe005]:could not open source file "hal.h" C:UsersuserDesktop例子程序无线通信综合测试Librarycc2430HALsourcesetTimer34Period.c

原因:先检查C:UsersuserDesktop例子程序无线通信综合测试Librarycc2430HALsource有无setTimer34Period.c这个文件,若有,则是因为IAR对中文路径支持不好的缘故,把这个工程复制到英文路径下编译就不会发生错误。

Error[e16]: Segment CODE_C (size: 0x1869 align: 0) is too long for segment definition. At least 0x1259 more bytes needed.

原因:CODE不够了,在xcl文件中修改其大小,0x28FF+0x1259=0x3B58,设置为-D_CODE_END=0x3B58

Error[e16]: Segment XDATA_Z (size: 0x1ea7 align: 0) is too long for segment definition. At least 0x2a7 more bytes

原因:在xcl文件里修改段大小,-D_IXDATA_END=0xFD53// Revison D (this setting is safe for all revisions)还有可能是定义的大数组太多了,有时候某些函数中定义的数组有点大,在主函数中单独测试这个函数时不会报错

Error[e16]: Segment CSTACK (size: 0x50 align: 0x1) is too long for segment definition. At least 0x50 more bytes needed. The problem occurred while processing the segment placement command "-Z(DATA)CSTACK+_STACK_SIZE#",

原因:此错误是所定义的全局变量和数组缓冲区等所占的RAM超出硬件支持所致,size: 0x50为超出的大小。只要减少不要的全局变量和尽量缩小数组缓冲区就可以了!

Error[e46]: Undefined external "OnBoard_SendPhoto::?relay" referred in hal_key ( C:Texas InstrumentsZStack-1.4.3-1.2.1ProjectszstackSamplesSimpleAppCC2430DBSimpleControllerEBObjhal_key.r51 )

原因:只有没有找到该函数的定义OnBoard_SendPhoto(),只有声明和使用。一般在链接时发生此错误。

Error[e89]:Too m h object code prod ed(more than 0x1000 bytes)for this package

原因:4K限制版,请使用非限制版的。

IAR常见错误请先从以下几个方面入手:

1、序列号是否正确。

2、使用版本是否正确,应该使用7.30B打开的工程文件不能用7.20H打开。

3、尽量不要使用中文路径。

4、Zigbee协议栈文件夹需要放在IAR安装盘根目录下。

5、请确定当前编译文件夹是否有读写权限。

6、使用的版本是否为限制版。

下面是我自己的补充(不断更新哦)

1.Error[e16]: Segment CODE (size: 0xffe align: 0x1) is too long for segment definition. At least 0x4a more bytes needed. The problem occurred while processing the segmentplacement command "-Z(CODE)CODE=_..X_FLASH_BASE-_..X_FLASH_END", where at the moment of placement the available memory ranges were "CODE:4b-fff"

Reserved ranges relevant to this placement:

CODE:34-44NEAR_F
CODE:45-4aINITTAB

CODE:4b-fffCODE

这个我的修改是 project options---->C/C++ Compiler----->Optimizations(最优化)----->size----->High(maximum optimization)

也就是,将代码最大限度的优化,以节省空间。
2.configuration is up-to-data.

在新建工程时,添加程序文件,需注意,必须添加有效的.c或者汇编文件。

嘿嘿,笔者新建工程时,保存的.c文件经常忘记加后缀,添加进入工程时,系统无法识别,这种低级错误写出来是自己提醒自己的。

3. Warning[Pe069]: integer conversion resulted in truncation程序如下:
#define SEG_A~0x04
#define SEG_B~0x01
#define SEG_C~0x40
#define SEG_D~0x10
#define SEG_E~0x08
#define SEG_F~0x02
#define SEG_G~0x80
#define SEG_H~0x20

SEG_A&SEG_B&SEG_G&SEG_D&SEG_E,//2

原因:后来将SEG_A到SEG_H的值求出来之后,eg,~0x04改为0xFB.问题就解决,因该是以数组中计算量过复杂。



关键词:IAR编译常见错

评论


技术专区

关闭