无编号警告类型:
1、Sat Jun 23, 2012 17:41:05: The stack pointer for stack 'Stack' (currently Memory:0xF5336) is
原因:/s/blog_4c0cb1c0010153l9.html
IAR相关设置:Tools->Option->Stack->Warn when stack pointer is out of bounds.
2、无法查看结构体/共同体/联合体 变量[Syntax error, unexpected $end, expecting COLON2] column 1
改成:
参考:/group/lpc2000/messages/34213?threaded=1&m=e&var=1&tidx=1
IAR 各版本BUG错误修正历史:ftp:///pub/efo-ftp/TMP/pub/atmel/_AVR32_MCUs_32bit/Compilers/IAR/IAR_2.20/Install software/EWAVR32-KS-CD-220A/doc/common/doc/
有编号警告类型:
Error[e16]: Segment XDATA_Z (size: 0x19a1 align: 0) is too long for segment definition. At least 0xe4c more bytes needed. The problem occurred while processing the segment placement command
"-Z(XDATA)XDATA_N,XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:f1ff-fd53"
Reserved ranges relevant to this placement:
XDATA:f000-f1fe XSTACK
XDATA:f1ff-fd53 XDATA_N
BIT:0-7 BREG
BIT:80-97 SFR_AN
BIT:a8-af SFR_AN
BIT:b8-c7 SFR_AN
BIT:d8-df SFR_AN
BIT:e8-ef SFR_AN
A:
其实这个问题并不是你的程序本身有问题,主要是因为你编写的程序太大了,超出了芯片本身的定义。今天在群里学习了一招,就是将数组定义到code里,我们看一下例子。我们定义一个5100个元素的数组,有以下两种方法:
mermaid提出的方法是:
typedef unsigned char const __code INT8U;
extern INT8U shuzi[5100];
文晶提出的方法是
INT8U code shuzi[5100];
这两种方法其实效果是一致的,定义完数组之后,调用的部分就是需要用指针来调用数组里面的数值了。
Error[e16]: Segment DATA16_I (size: 0xa80 align: 0x1) is too long for segment definition. At least 0x27f more bytes needed. The 经过验证是由于RAM耗尽,程序里估计有很大的数据量,最好使用const定义到FLASH里面,问题基本可以解决。 |
2Q:
烧写程序时无法跳入断点
为什么我每次烧程序都出现:The stack plug-in failed to set a breakpoint on "main". The Stack window will not be able to display stack contents. (You can change this setting in the Tool>Options dialog box.)的警告。但是程序能烧进去,只是不能调试。
A:
确认设置没有问题(和好用的工程相比)这是设置不对,请找下面顺序修改:
iar->options->linker->output->format;
选择 Debug information for c-SPY选项
3Q:
错误提示:
Fatal Error[Cp001]: Copy protecTIon check, No valid license found for this product [20]
A:
可以将IAR全部安装上,但是在编译文件时却会报这个错,原因是安装的时候没有把注册机的0x.....字串的小写字母改为大写字母。
4Q:
“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#", ”
A:
此错误是所定义的全局变量和数组缓冲区等所占的RAM超出硬件支持所致:size: 0x50为超出的大小。只要减少不不要的全局变量和尽量缩小数组缓冲区就可以了!
5Q:
7Q:
Error[Pe018]: expected a ")" C:Documents and SettingsAdministrator桌面CraneCrane塔吊防碰撞系统1.1版(SIM908 倾角查询)5438A塔吊防碰撞1.1api_function.h 5
1、函数或者语句中有变量名复用:
#define length 50
extern int dec_to_bcd(int dec_dat, unsigned char *bcd, int length);
将以上的变量名之一换做别的即可解决。
UESTC 2012.3.27
/s/blog_4c0cb1c00100z0w1.html
Error[e27]: Entry "ER_WARN" in module AD (……) redefined in module FINGERPRINT (……)
解决方法是把变量定义在其中一个cpp文件里面,
然后在另一个文件里面用extern来引用。
sample:
文件一:
int a=0;
文件二:
extern int a;
以为我在文件中定义有变量,然后放入 中,被其他的各个.c文件包含,就造成了,中的变量在各个.c中定义,造成了重复定义。 UESTC 2012.3.27
相关问答:
/u/20120222/22/
14Q:Error[e46]:
A:该问题应该是IAR设置问题,具体设置如下:
Project->Option->Linker->Config 勾选"Override default program"
再选择"Defined by application"
Error[Pe077]:
this declaration has no storage class or type specifier
2012. UESTC
8Q:
Error[Pe136]:
//--------------------------------------------//
afAddrType_t dstAddr;
= afAddrBroadcast;
= 0xFFFF; // 广播发送 cdwxl
= SAMPLEAPP_ENDPOINT; //error所在
//--------------------------------------------//
A:
我们看看afAddrType_t这个结构就明白错在哪里了。
typedef struct
{
union
{
uint16 shortAddr;
} addr;
afAddrMode_taddrMode;
byteendPoint;
} afAddrType_t;
居然是 endPoint 大小写错误,Ω 。
9Q:
我最开始也是IAR仿真时找不到main函数,
显示:
Fri Jun 11 14:37:00 2010: Error (col 1): Unknown or ambiguous symbol. main
Fri Jun 11 14:37:01 2010: Error (col 1): Unknown or ambiguous symbol. main
Fri Jun 11 14:37:01 2010: Couldn't go to 'main'.
之后在project==>options==>linker里面的format设成debug,没有这个问题了,但是
程序又不能通过TI的那个Flash Programmer下载到板子里了,说是Could not open specified HEX file
A:
这个烧录工具只认release code. 而且扩展名必须是.hex。
所以要用这个烧录工具来烧录必须做两件事:
1. output file设为release version
2. output file 扩展名改为.hex, 默认的是.a51
测试学习阶段可以不用.但产品量产就必须生成二进制文件.
同时programmer还有些其它的功能会常用的
表达式两边的类型不一样。2012. uestc
例如:
如果p是个指针,那么*(p+i)是p后面第i个域或单元的元素,这个域与p所指的变量类型有关,
也就是说'*(p+i)+j'是数,而非指针。与*结合就错了。 ”
/bbs/bbs_content.jsp?bbs_sn=931945
C++的该错误:
/Question/1-4943607/Expression-Must-Pointer-Object-Type-Subscript-Requires-Array-Pointer-Type
Error[Pe148]:
variable "TA1R_OVERFLOW" has already been initialized
"unsigned char TA1R_OVERFLOW=0; " 声明可外部调用需要赋值
Error[Pe159]: declaration is incompatible with previous
Error[Pe169]: expected a declaration
错误原因可能性:
1、void read_gprs_return();
{
……
}
定义函数的时候,结尾多了一个分号:;。
Error[Pe852]:
Error[Pe852]:expression must be a pointer to a complete object type
请教关于结构体数组的引用出错
:
struct StructDisData
{
unsigned int AddrDisData;
unsigned int TypeDisChar;
unsigned int TypeDisUnit;
unsigned char LengthDisData;
};
const struct StructDisData StrDisData[254]={.....};
:
const extern struct StructDisData StrDisData[254];
在中引用:
#include ""
unsigned int vAdd;
void Sub1(void)
{
unsigned int disptr;
disptr =...;
vAdd =StrDisData[disptr].AddrDisData; //编译时在此处出错 Error[Pe852]: expression must be a pointer to a complete object type
}
各位大虾请帮我分析一下 谢谢!
vAdd =StrDisData[disptr]->AddrDisData;
试试?
我改了试了一下 还是一样的错误
好像->是用指针方式调用才用到
struct StructDisData
{
unsigned int AddrDisData;
unsigned int TypeDisChar;
unsigned int TypeDisUnit;
unsigned char LengthDisData;
};
放到头文件中,即.h文件中
用iltgcl的方法试了一下 编译没问题了!
:
:
struct StructDisData
{
unsigned int AddrDisData;
unsigned int TypeDisChar;
unsigned int TypeDisUnit;
unsigned char LengthDisData;
};
:
#include ""
unsigned int vAdd;
const struct StructDisData StrDisData[254]={.....};
void Sub1(void)
{
unsigned int disptr;
disptr =...;
vAdd =StrDisData[disptr].AddrDisData;
}
再次谢谢各位工程师的热心指点!
Error[Pe260]:
问题例子1:定义一个函数,落了红字部分声明
void DrawSector(int x,int y,int R1,int R2,float Ds ,float De,int fill,uchar color)
{
}
11Q:Error[Pe513]:
A:估计是一个函数本没有返回值即void类型,而你却将这个函数赋给了一个int型变量了。。
static rxCB( uint8 port,uint8 event )改为
static void rxCB( uint8 port,uint8 event )
12Q:
Fatal Error[e72]: Segment BANK_RELAYS must be defined in a segment definition option (-Z, -b or -P)
A:
使用无线龙的串口互发,发现上述错误,原因是版本太高,具体原因不清,下载一下7.20H就可以了
Fatal Error[e89]: Too much object code produced (more than 0x1000 bytes) for this package
是4K限制版,请使用有非限制版的。
IAR常见错误请先从如下几方面入手:
1序列号是否正确。
2使用版本是否正确,应该使用7.30B打开的工程文件不能使用7.20H打开。
Fatal Error[Pe005]: could not open source file "" 这是什么原因?谢谢了
是因为头文件路径不对造成,改正的方法是在设置选项卡的C/C++ Compiler -> Preprocessor选项里,将$TOOLKIT_DIR$INCCLIB添到Include paths中。($TOOLKIT_DIR$指IAR的安装路径,一般用到标准库函数时要将它写入Include paths里面)
Fatal Error[Pe005]: could not open source file "" C:UsersuserDesktop例子程序无线通信综合测试Librarycc2430HALsourcese
先检查 C:UsersuserDesktop例子程序无线通信综合测试Librarycc2430HALsource有无 这个文件,若有,则是因为IAR对中文路径支持不好的缘故,你把这个工程复制到全英文路径下编译应该就不会报错了。
Fatal Error[Pe1696]: cannot open source file ""
注意 存放的位置,最好与main同处于一个文件夹
15Q:
Fatal Error[Cp001]:
XP下装的IAR,到了Win7下出来的问题。
A:这个问题是使用注册机带来的,系统换了,本机ID也要改了。
、、单击得到本机的ID号
、、右键点,选择编辑,打开,将ID修改为本机ID
、、运行,在中的含有EW8051-EV的序列号就是7.30的序列号
16Q:
在用iar debug 下载进已有程序板子出现的
A:将核心板与扩展板分开,只烧写核心板。
17Q:
A:自小峰关于协议栈XDATA溢出的小结
(1)减小程序;
(2)把配置文件/中的-D_CODE_END改大点:
********************
:
// CODE
//
// These settings determine the size/location of the ROOT segment.
// Increase _CODE_END to increase ROOT memory, . for constants.
-D_CODE_START=0x0000 // Code size = 128k for CC2430-F128
-D_CODE_END=0x4000 // Last address for ROOT bank
********************
:
// CODE
//
// These settings determine the size/location of the ROOT segment.
// Increase _CODE_END to increase ROOT memory, . for constants.
-D_CODE_START=0x0000 // Code size = 128k for CC2430-F128
-D_CODE_END=0x29FF //(原0x28FF) Last address for ROOT bank
Warning[Pe001]: last line of file ends without a newline F:emoTionIARPK升级 179
A:
在使用IAR时常常会弹出类似这样一个警告,其实只要在最后一行多加一个回车就不会再有这个警告了.
6Q:
在编写一个串口程序时:编译没有错,但MAKE时就出现下面的错误
undefined external“UART1_ISR”referred in startup
A:
串口1中断向量没有定义,实际上是串口1中断向量定义其他名称,而不是UART1_ISR.
出现这样的调试IAR错误时:Fatal error: Unknown exception in driver (#E1),是因为IAR软件没有跟Texas Instruments文件放在同一个系统盘下
Warnin[w6]:
different
你看看你的源代码里函数是不是这样写:void 而.h代码里这样声明:void .h代码应该这样声明:void |
分析:一般Warnin[w6]:问题出在头文件里头,可能有:
1、声明了外部变量,但是用到那个函数的.c文件没有包含那个头文件
2、源代码函数和.h里声明的函数不一样:.c里 void
3、在.C中定义了,但是没有extern void clean_uart2_rx_buff();声明外部可调用,然后外部调用了它,就有可能出现。 2012.3.26 UESTC
Warning[Pe009]: nested comment is not allowed
注释最好不要嵌套
例如注释1后半部*/
就是最好不要这样
运算符两边都是volatile变量的警告
这警告有意义.
volatile 意思是:易变的。
用volatile修饰的变量一般不直接参与运算(在运算中值可能在变化),volatile就以为这个变量在运算过程中有可能已经改变了
例如:想计算a * b 要这样:
volatile unsigned char a;
volatile unsigned char b;
unsigned char x,y;
x = a;
y = b;
return (x * y);
建议使用另外一个变量参与计算:
volatile char VVV = 9;
char fun()
{
char xxx;
char yyy = 9;
xxx = VVV;
return xxx * yyy
}
编译错误:Warning[Pe175]:
2011年 6月2日
A:函数虽定义但从未被引用(使用)。如果你需要使用该函数,就需要检查;否则略过。
13Q:
Fri Jun 11 14:37:00 2010: Error (col 1): Unknown or ambiguous symbol. main
Fri Jun 11 14:37:01 2010: Error (col 1): Unknown or ambiguous symbol. main
Fri Jun 11 14:37:01 2010: Couldn't go to 'main'.
A:project==>options==>linker 看看里面的format是不是设成debug
详见/bbs/
无符号整数不可能小于0的……
10Q:Warning[Pe188]:
A: SampleApp_Periodic_DstAddr.addrMode = Addr16Bit;//(afAddrMode_t)afAddrGroup;
typedef enum
{
afAddrNotPresent = AddrNotPresent,
afAddr16Bit = Addr16Bit,
afAddrGroup = AddrGroup,
afAddrBroadcast = AddrBroadcast
} afAddrMode_t;
问题就在于Addr16Bit未加afAddrMode_t这个套子。
Warning[Pe1072]: a declaration cannot have a label