从IAR6.0过度到IAR6.3出现的编译出错问题解决办法
IAR 6.3 无法编译问题
1 在用IAR编译SVN上下载的RT-THREAD 1.0.1时,出现很多的错误,如下:......Error[Pe147]:declaration is incompatible with"__nounwind__interwork __softtp unsigned long __REV16(unsigned long)"(declared at line 177 of "C:\Program Files(x86)\IAR Systems\Embedded Workbench 6.0 Evaluation\arm\inc\c\intrinsics.h"......错误都是出现在intrinsics.h文件里,咨询过RT-THREAD设计群后解决了此问题。
方法如下:1:Project options > General Options > LibraryConfiguration 里选择USE CMSIS ;2:在Project>Options>C/C++Compiler>Preprocessor里删除所有的CMSIS header files ,“$PROJ_DIR$\..\..\..\Libraries\CMSIS\CM3\CoreSupport” 。
2. 然后出现错误将程序所在目录中的Library/CMSIS/Core/CM3文件夹下的三个.c / .h ----system_stm32f10x.c、system_stm32f10x.h 、stm32f10x.h 三个文件剪切到Library 目录下的STM32F10x_StdPeriph_Driver文件夹下lib_cfg文件夹中。
3.在打开的程序中,将Core中的system_stm32f10x.c、system_stm32f10x.h 、stm32f10x.h 三个文件remove4.右键单击Library Add Files ,将刚才复制到Library 目录下的STM32F10x_StdPeriph_Driver文件夹下lib_cfg文件夹中的三个文件再添加进来5.这样就编译通过了。
IAR编译错误
IAR编译错误清单Warning[Pe1665]: concatenation with "PDOR" in macro "PT" does not create a valid token E:\All learning files\IAR files\四轴\电调\VCANBLDC\Board\src\VCAN_NRF24L0.c 317警告:“PDDR”宏“PT”不创建有效的TOK级联未解1,错误:Error[Li005]: no definition for "__VECTOR_TABLE" [referenced from F:\k60 example\ E04 WOTCHDOG\Watdog\Debug\Obj\vectors.o]Error[Li005]: no definition for "__VECTOR_RAM" [referenced from F:\k60 example\E 04 WOTCHDOG\Watdog\Debug\Obj\vectors.o]Error[Li005]: no definition for "__BOOT_STACK_ADDRESS" [referenced from F:\k60 example\E04 WOTCHDOG\Watdog\Debug\Obj\vectors.o]错误原因(见下图):在linker里没有设置icf文件的路径。
说2,错误:Warning[Pe223]: function "LCD_Init" declared implicitly D:\All learning files\IA R files\exercise\Project\files\main.c 30files\exercise\Project\files\main.c 31Warning[Pe223]: function "LCD_P8x16Str" declared implicitly D:\All learning files\IAR files\exercise\Project\files\main.c 40Warning[Pe223]: function "LCD_P6x8Str" declared implicitly D:\All learning files\IAR f iles\exercise\Project\files\main.c 41Warning[Pe223]: function "LCD_CLS" declared implicitly D:\All learning files\IAR files\ exercise\Project\files\main.c 44Error[Pe020]: identifier "longqiu96x64" is undefined D:\All learning files\IAR files\exer cise\Project\files\main.c 45或者:Error[Pe101]: "uint8" has already been declared in the current scope (at line 72 of "D:\All learning files\IAR files\exercise\ D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Project\iar\..\..\LIB\cpu\arm_cm4.h")Error[Pe070]: incomplete type is not allowed D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Error[Pe065]: expected a ";" D:\All learning files\IAR files\exercise\LIB\drivers\LQ1286 4\LQ12864.h 10Error while running C/C++ Compilermain.cError[Pe101]: "uint8" has already been declared in the current scope (at line 72 of "D:\All learning files\IAR files\exercise\ D:\All learning files\IAR files\exercise\LIB\drive rs\LQ12864\LQ12864.h 10Project\iar\..\..\LIB\cpu\arm_cm4.h")Error[Pe070]: incomplete type is not allowed D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Error[Pe065]: expected a ";" D:\All learning files\IAR files\exercise\LIB\drivers\LQ1286 4\LQ12864.h 10Warning[Pe223]: function "LCD_Init" declared implicitly D:\All learning files\IAR files\e xercise\Project\files\main.c 30Warning[Pe223]: function "Draw_LibLogo" declared implicitly D:\All learning files\IAR files\exercise\Project\files\main.c 31files\exercise\Project\files\main.c 40Warning[Pe223]: function "LCD_P6x8Str" declared implicitly D:\All learning files\IAR f iles\exercise\Project\files\main.c 41Warning[Pe223]: function "LCD_CLS" declared implicitly D:\All learning files\IAR files\ exercise\Project\files\main.c 44Error[Pe020]: identifier "longqiu96x64" is undefined D:\All learning files\IAR files\exer cise\Project\files\main.c 45Error while running C/C++ Compiler注意:我这是把LQ12864.h中的void byte longqiu96x64[768];//void LCD_Init(void);//void LCD_CLS(void);//void LCD_P6x8Str(byte x,bytey,bytech[]);//void LCD_P8x16Str(byte x,bytey,bytech[]);//void LCD_P14x16Str(byte x,bytey,bytech[]);voidLCD_Print(byte x, byte y, byte ch[]);// void LCD_PutPixel(byte x,byte y);//void LCD_Rectangle(byte x1,byte y1,byte x2,byte y2,byte gif);//void Draw_LQLogo(void);//void Draw_LibLogo(void);看到没我都给注释了,然后出现这么多错误,最后又把本来是extern byte longqiu96x64[7 68];改成voidbyte longqiu96x64[768];于是出现了:Error[Pe101]: "uint8" has already been declared in the current scope (at line 72 of "D:\All learning files\IAR files\exercise\ D:\All learning files\IAR files\exercise\LIB\drive rs\LQ12864\LQ12864.h 10Project\iar\..\..\LIB\cpu\arm_cm4.h")Error[Pe070]: incomplete type is not allowed D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Error[Pe065]: expected a ";" D:\All learning files\IAR files\exercise\LIB\drivers\LQ1286 4\LQ12864.h 10Error while running C/C++ CompilerIAR 6.20编译错误清单1、①错误描述:Tool Internal Error:Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Error while running C/C++ Compiler②错误原因:High配置设置为Size,应该为Low2、①错误描述:Fatal Error[Pe1696]: cannot open source file "inc/hw_types.h" E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\boot_demo2\boot_demo2.c 25②错误原因:C/C++ Complier(Assember)->Preprocessor->Additional include directories:$PROJ_DIR$\.$PROJ_DIR$\..$PROJ_DIR$\..\..\..3、①错误描述:Fatal Error[Pe1696]: cannot open source file "lwip/opt.h" E:\StellarisWareM3_9D92\utils\lwiplib.h 44②错误原因:C/C++ Complier-(Assember)>Preprocessor->Additional include directories:$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\apps$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\ports\stellaris\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\ipv4$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\lwip$PROJ_DIR$\..\..\..\third_party4、①错误描述:Fatal Error[Pe035]: #error directive: Unrecognized COMPILER! E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\drivers\set_pinout.h 59Error while running C/C++ Compiler②错误原因:C/C++ Complier-(Assember)>Preprocessor->Defined symbols: ewarm5、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\StellarisWareM3_9D92\third_party\aes\aes.c 319②错误原因:6、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:定义函数:intmain(void){ return (0);}7、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:如果是库是库函数,在:General Options->Output->Output file:选择:Library项4、①错误描述:Fatal Error[Pe1696]: cannot open source file "uip.h" E:\StellarisWareM3_9D92\third_party\uip-1.0\apps\dhcpc\dhcpc.c 37②错误原因:5、①错误描述:②错误原因:$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\apps$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\ports\stellaris\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\ipv4$PROJ_DIR$\..\..\..\third_party$PROJ_DIR$\..\..\..\third_party\uip-1.0$PROJ_DIR$\..\..\..\third_party\uip-1.0\uip$PROJ_DIR$\..\..\..\third_party\uip-1.0\apps$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include\speex$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\stellaris6、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\StellarisWareM3_9D92\third_party\speex-1.2rc1\libspeex\arch.h 65②错误原因:7、①错误描述:Fatal Error[Pe035]: #error directive: "Unrecognized/undefined driver for DISK0!" E:\StellarisWareM3_9D92\third_party\fatfs\port\dual-disk-driver.c 62Error while running C/C++ Compiler②错误原因:UART_BUFFEREDDISK0_DK_LM3S9B96DISK1_USB_MSCINCLUDE_BGET_STATS8、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\SWM3_9D92(6.20)\third_party\aes\aes.c 359Error while running C/C++ Compiler②错误原因:10、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\SWM3_9D92(6.20)\third_party\speex-1.2rc1\libspeex\arch.h 65Error while running C/C++ Compiler②错误原因:11、①错误描述:Error[Li005]: no definition for "ROM_SysCtlClockSet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\safertos_demo.o] Error[Li005]: no definition for "ROM_FlashUserGet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o] Error[Li005]: no definition for "ROM_IntPrioritySet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o] Error[Li005]: no definition for "ROM_GPIOPinTypeGPIOOutput" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Li005]: no definition for "ROM_GPIOPinWrite" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in <[0x20000000-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker②错误原因:12、①错误描述:Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in <[0x20000000-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker。
IAR 编译错误信息表
编译错误信息表15 ‘,’or’)’expected(预待’,’或‘)’) 编译器发现函数定义头部或宏定义的句法无效16 Identifier expected(期待识别符) 在声明、goto语句或预处理器行中丢失识别符17 Space or tab expected(期待空格或制表符) 必须用制表或空格字符把预处理器参数与伪指令隔开。
18 Macro parameter ‘name’ redefined(宏参数‘name’被重定义) #define语句中符号的形式参数被重复19 Unmatched #else,#endif或#elif(不匹配的# else,#endif 或#elif) 致命错误。
丢失了#if,#ifdef或#ifdef20 No such pre-processor command:’name’(无这样的预处理命令)#后随未知的识别符21 Unexpected token found in pre-processorline(在预处理器行中发现未预期的记号)在读参数部分之后预处理器行不空。
22 Too many nested parameterized macro(maxis50)(嵌套参数化宏太多)致命错误。
预处理器极限被超过。
23 Too many active macro parameters(max is250)(有效宏参数太多(最大为250))致命错误。
预处理器极限被超过。
24 Too deep macro nestiong(max is 100)(宏嵌套太深(最大为100))致命错误。
预处理器极限被超过。
25 Macro ‘name’called with too manyparameters(用太多的参数调用宏‘name’) 致命错误。
用比声明更多的参数调用参数化的#define宏。
26 Actual macro parameter too long(max is512)(实际宏参数太长(最大为512)单个宏参数不能超过源代码行的长度27 macro ‘name’called with too fewpatameters(用太少的参数调用宏‘name’) 用比声明更少的参数调用参数化#define宏28 Missing #endif(遗漏#endif) 致命错误。
IAR620编译错误
IAR 6.20编译错误清单1、①错误描述:Tool Internal Error:Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Error while running C/C++ Compiler②错误原因:High配置设置为Size,应该为Low2、①错误描述:Fatal Error[Pe1696]: cannot open source file "inc/hw_types.h"E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\boot_demo2\boot_demo2.c 25②错误原因:C/C++ Complier(Assember)->Preprocessor->Additional include directories:$PROJ_DIR$\.$PROJ_DIR$\..$PROJ_DIR$\..\..\..3、①错误描述:Fatal Error[Pe1696]: cannot open source file "lwip/opt.h"E:\StellarisWareM3_9D92\utils\lwiplib.h 44②错误原因:C/C++ Complier-(Assember)>Preprocessor->Additional include directories:$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party4、①错误描述:Fatal Error[Pe035]: #error directive: Unrecognized COMPILER! E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\drivers\set_pinout.h 59Error while running C/C++ Compiler②错误原因:C/C++ Complier-(Assember)>Preprocessor->Defined symbols: ewarm5、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\StellarisWareM3_9D92\third_party\aes\aes.c 319②错误原因:6、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:定义函数:int main(void) { return (0); }7、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:如果是库是库函数,在:General Options->Output->Output file:选择:Library项4、①错误描述:Fatal Error[Pe1696]: cannot open source file "uip.h" E:\StellarisWareM3_9D92\third_party\uip-1.0\apps\dhcpc\dhcpc.c 37②错误原因:5、①错误描述:②错误原因:$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party\lwip-$PROJ_DIR$\..\..\..\third_party$PROJ_DIR$\..\..\..\third_party\uip-1.0$PROJ_DIR$\..\..\..\third_party\uip-1.0\uip$PROJ_DIR$\..\..\..\third_party\uip-1.0\apps$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include\speex$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\stellaris6、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\StellarisWareM3_9D92\third_party\speex-1.2rc1\libspeex\arch.h 65②错误原因:7、①错误描述:Fatal Error[Pe035]: #error directive: "Unrecognized/undefined driver for DISK0!" E:\StellarisWareM3_9D92\third_party\fatfs\port\dual-disk-driver.c 62Error while running C/C++ Compiler②错误原因:UART_BUFFEREDDISK0_DK_LM3S9B96DISK1_USB_MSCINCLUDE_BGET_STATS8、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\SWM3_9D92(6.20)\third_party\aes\aes.c 359Error while running C/C++ Compiler②错误原因:10、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\SWM3_9D92(6.20)\third_party\speex-1.2rc1\libspeex\arch.h 65Error while running C/C++ Compiler②错误原因:11、①错误描述:Error[Li005]: no definition for "ROM_SysCtlClockSet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\safertos_demo.o]Error[Li005]: no definition for "ROM_FlashUserGet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o]Error[Li005]: no definition for "ROM_IntPrioritySet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o]Error[Li005]: no definition for "ROM_GPIOPinTypeGPIOOutput" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Li005]: no definition for "ROM_GPIOPinWrite" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in<[0x-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker②错误原因:12、①错误描述:Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in <[0x-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker。
IAR 编译错误信息表
编译错误信息表15 ‘,’or’)’expected(预待’,’或‘)’) 编译器发现函数定义头部或宏定义的句法无效16 Identifier expected(期待识别符) 在声明、goto语句或预处理器行中丢失识别符17 Space or tab expected(期待空格或制表符) 必须用制表或空格字符把预处理器参数与伪指令隔开。
18 Macro parameter ‘name’ redefined(宏参数‘name’被重定义) #define语句中符号的形式参数被重复19 Unmatched #else,#endif或#elif(不匹配的# else,#endif 或#elif) 致命错误。
丢失了#if,#ifdef或#ifdef20 No such pre-processor command:’name’(无这样的预处理命令)#后随未知的识别符21 Unexpected token found in pre-processorline(在预处理器行中发现未预期的记号)在读参数部分之后预处理器行不空。
22 Too many nested parameterized macro(maxis50)(嵌套参数化宏太多)致命错误。
预处理器极限被超过。
23 Too many active macro parameters(max is250)(有效宏参数太多(最大为250))致命错误。
预处理器极限被超过。
24 Too deep macro nestiong(max is 100)(宏嵌套太深(最大为100))致命错误。
预处理器极限被超过。
25 Macro ‘name’called with too manyparameters(用太多的参数调用宏‘name’) 致命错误。
用比声明更多的参数调用参数化的#define宏。
26 Actual macro parameter too long(max is512)(实际宏参数太长(最大为512)单个宏参数不能超过源代码行的长度27 macro ‘name’called with too fewpatameters(用太少的参数调用宏‘name’) 用比声明更少的参数调用参数化#define宏28 Missing #endif(遗漏#endif) 致命错误。
如何处理代码中的编译器错误
如何处理代码中的编译器错误编写代码时,经常会遇到编译器错误。
这些错误可能是语法错误、类型错误、逻辑错误等。
对于初学者来说,正确处理这些错误是一项重要的技能。
本文将介绍一些处理编译器错误的方法,帮助您更好地解决问题。
处理编译器错误的步骤如下:1.仔细阅读错误信息:当编译器发现错误时,它会生成错误信息,通常包括错误的类型、错误的位置和相关的详细信息。
首先,要仔细阅读错误信息,理解错误的类型和位置。
2.检查错误的代码行:根据错误信息,找到代码中与错误相关的行。
检查这些行,看看是否有明显的错误,比如拼写错误、缺少分号等。
3.阅读文档或向导:如果您遇到不熟悉的错误,可以阅读编程语言的官方文档、教程或向导,寻找错误的解决方案。
这些资源通常提供了常见错误的解释和解决方法。
4.使用搜索引擎:如果您无法找到编程语言的文档或解决方案,可以使用搜索引擎搜索错误信息或相关关键字。
通常会有其他开发者遇到类似的问题,并提供了解决方法。
5.检查变量和函数:编译器错误可能与变量或函数的类型不匹配有关。
检查相关的变量和函数声明,并确保它们的类型正确。
如果类型不匹配,可能需要修改它们的声明或进行类型转换。
6.注释或删除问题代码:如果错误是由于特定代码行引起的,可以尝试注释掉该行或删除它,然后重新编译程序。
如果编译成功,可以逐步恢复修改,找出引起错误的具体原因。
7.检查依赖库或模块:如果错误涉及到使用第三方库或模块,可能是由于缺少依赖项或版本不兼容引起的。
确保已正确安装和配置所需的依赖库,并检查版本是否匹配。
8.请求帮助:如果您尝试了以上方法仍然无法解决错误,可以寻求他人的帮助。
您可以向同事、论坛、开发者社区或在线编程问答网站(如Stack Overflow)提问,并提供尽可能详细的错误信息和相关代码。
9.实验和调试:处理编译器错误通常需要进行反复尝试和实验。
您可以尝试修改代码、引入调试语句、使用调试工具等,来定位和解决问题。
如果可能,尝试在更简化的环境中复现错误,以便更容易找到问题。
IAR相关问题处理办法,及其注意事项
问题一:IAR中如何做位定义,位操作以前在STVD中,使用如下语句做位定义_Bool L1 @PA_ODR : 6; //数码管个位, 低电平点亮_Bool L2 @PA_ODR : 5; //数码管十位, 低电平点亮_Bool L3 @PA_ODR : 4; //数码管百位, 低电平点亮但是同样的语句在IAR中不能用了,编译时报错。
后来,查看IAR中的头文件 "iostm8s207rb.h",看到如下语句/*-------------------------------------------------------------------------* Port A bit fields*-----------------------------------------------------------------------*/#ifdef __IAR_SYSTEMS_ICC__#define PA_ODR_ODR0 PA_ODR_bit.ODR0#define PA_ODR_ODR1 PA_ODR_bit.ODR1想想看:既然可以用PA_ODR_ODR1来指定某个位,那么我再将某个位用define重新定义为我想要的名字不就可以了吗?心动不如行动,于是写下如下语句:#define Sound_K PA_ODR_ODR6; //语音控制K原本以为十拿九稳,肯定能编译通过,结果现实狠狠地教训了我一下,报错!Error【Pe029】:expected an expression我百思不得其解,以为IAR不支持这种重复定义的方式,于是换用bool,_Bool, _bool, bit ......各种方法尝试,结果均以失败告终,事情似乎走到了尽头。
最后,抱着试一试的想法,我把原头文件中的语句#define PA_ODR_ODR6 PA_ODR_bit.ODR6换成#define Sound PA_ODR_ODR6 //语音控制K结果,编译通过了,我真是泪流满面啊,没想到问题解决了。
IAR编译毛病
IAR编译错误清单Warning[Pe1665]: concatenation with "PDOR" in macro "PT" does not create a valid token E:\All learning files\IAR files\四轴\电调\VCANBLDC\Board\src\VCAN_NRF24L0.c 317警告:“PDDR”宏“PT”不创建有效的TOK级联未解1,错误:Error[Li005]: no definition for "__VECTOR_TABLE" [referenced from F:\k60 example\ E04 WOTCHDOG\Watdog\Debug\Obj\vectors.o]Error[Li005]: no definition for "__VECTOR_RAM" [referenced from F:\k60 example\E 04 WOTCHDOG\Watdog\Debug\Obj\vectors.o]Error[Li005]: no definition for "__BOOT_STACK_ADDRESS" [referenced from F:\k60 example\E04 WOTCHDOG\Watdog\Debug\Obj\vectors.o]错误原因(见下图):在linker里没有设置icf文件的路径。
说2,错误:Warning[Pe223]: function "LCD_Init" declared implicitly D:\All learning files\IA R files\exercise\Project\files\main.c 30files\exercise\Project\files\main.c 31Warning[Pe223]: function "LCD_P8x16Str" declared implicitly D:\All learning files\IAR files\exercise\Project\files\main.c 40Warning[Pe223]: function "LCD_P6x8Str" declared implicitly D:\All learning files\IAR f iles\exercise\Project\files\main.c 41Warning[Pe223]: function "LCD_CLS" declared implicitly D:\All learning files\IAR files\ exercise\Project\files\main.c 44Error[Pe020]: identifier "longqiu96x64" is undefined D:\All learning files\IAR files\exer cise\Project\files\main.c 45或者:Error[Pe101]: "uint8" has already been declared in the current scope (at line 72 of "D:\All learning files\IAR files\exercise\ D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Project\iar\..\..\LIB\cpu\arm_cm4.h")Error[Pe070]: incomplete type is not allowed D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Error[Pe065]: expected a ";" D:\All learning files\IAR files\exercise\LIB\drivers\LQ1286 4\LQ12864.h 10Error while running C/C++ Compilermain.cError[Pe101]: "uint8" has already been declared in the current scope (at line 72 of "D:\All learning files\IAR files\exercise\ D:\All learning files\IAR files\exercise\LIB\drive rs\LQ12864\LQ12864.h 10Project\iar\..\..\LIB\cpu\arm_cm4.h")Error[Pe070]: incomplete type is not allowed D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Error[Pe065]: expected a ";" D:\All learning files\IAR files\exercise\LIB\drivers\LQ1286 4\LQ12864.h 10Warning[Pe223]: function "LCD_Init" declared implicitly D:\All learning files\IAR files\e xercise\Project\files\main.c 30Warning[Pe223]: function "Draw_LibLogo" declared implicitly D:\All learning files\IAR files\exercise\Project\files\main.c 31files\exercise\Project\files\main.c 40Warning[Pe223]: function "LCD_P6x8Str" declared implicitly D:\All learning files\IAR f iles\exercise\Project\files\main.c 41Warning[Pe223]: function "LCD_CLS" declared implicitly D:\All learning files\IAR files\ exercise\Project\files\main.c 44Error[Pe020]: identifier "longqiu96x64" is undefined D:\All learning files\IAR files\exer cise\Project\files\main.c 45Error while running C/C++ Compiler注意:我这是把LQ12864.h中的void byte longqiu96x64[768];//void LCD_Init(void);//void LCD_CLS(void);//void LCD_P6x8Str(byte x,byte y,byte ch[]);//void LCD_P8x16Str(byte x,byte y,byte ch[]);//void LCD_P14x16Str(byte x,byte y,byte ch[]);void LCD_Print(byte x, byte y, byte ch[]);// void LCD_PutPixel(byte x,byte y);//void LCD_Rectangle(byte x1,byte y1,byte x2,byte y2,byte gif);//void Draw_LQLogo(void);//void Draw_LibLogo(void);看到没我都给注释了,然后出现这么多错误,最后又把本来是extern byte longqiu96x64 [768];改成void byte longqiu96x64[768];于是出现了:Error[Pe101]: "uint8" has already been declared in the current scope (at line 72 of "D:\All learning files\IAR files\exercise\ D:\All learning files\IAR files\exercise\LIB\drive rs\LQ12864\LQ12864.h 10Project\iar\..\..\LIB\cpu\arm_cm4.h")Error[Pe070]: incomplete type is not allowed D:\All learning files\IAR files\exercise\LI B\drivers\LQ12864\LQ12864.h 10Error[Pe065]: expected a ";" D:\All learning files\IAR files\exercise\LIB\drivers\LQ1286 4\LQ12864.h 10Error while running C/C++ CompilerIAR 6.20编译错误清单1、①错误描述:Tool Internal Error:Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Error while running C/C++ Compiler②错误原因:High配置设置为Size,应该为Low2、①错误描述:Fatal Error[Pe1696]: cannot open source file "inc/hw_types.h" E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\boot_demo2\boot_demo2.c 25②错误原因:C/C++ Complier(Assember)->Preprocessor->Additional include directories:$PROJ_DIR$\.$PROJ_DIR$\..$PROJ_DIR$\..\..\..3、①错误描述:Fatal Error[Pe1696]: cannot open source file "lwip/opt.h" E:\StellarisWareM3_9D92\utils\lwiplib.h 44②错误原因:C/C++ Complier-(Assember)>Preprocessor->Additional include directories:$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\apps$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\ports\stellaris\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\ipv4$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\lwip$PROJ_DIR$\..\..\..\third_party4、①错误描述:Fatal Error[Pe035]: #error directive: Unrecognized COMPILER! E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\drivers\set_pinout.h 59Error while running C/C++ Compiler②错误原因:C/C++ Complier-(Assember)>Preprocessor->Defined symbols: ewarm5、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\StellarisWareM3_9D92\third_party\aes\aes.c 319②错误原因:6、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:定义函数:int main(void) { return (0); }7、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:如果是库是库函数,在:General Options->Output->Output file:选择:Library项4、①错误描述:Fatal Error[Pe1696]: cannot open source file "uip.h" E:\StellarisWareM3_9D92\third_party\uip-1.0\apps\dhcpc\dhcpc.c 37②错误原因:5、①错误描述:②错误原因:$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\apps$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\ports\stellaris\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\ipv4$PROJ_DIR$\..\..\..\third_party$PROJ_DIR$\..\..\..\third_party\uip-1.0$PROJ_DIR$\..\..\..\third_party\uip-1.0\uip$PROJ_DIR$\..\..\..\third_party\uip-1.0\apps$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include\speex$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\stellaris6、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\StellarisWareM3_9D92\third_party\speex-1.2rc1\libspeex\arch.h 65②错误原因:7、①错误描述:Fatal Error[Pe035]: #error directive: "Unrecognized/undefined driver forDISK0!" E:\StellarisWareM3_9D92\third_party\fatfs\port\dual-disk-driver.c 62Error while running C/C++ Compiler②错误原因:UART_BUFFEREDDISK0_DK_LM3S9B96DISK1_USB_MSCINCLUDE_BGET_STATS8、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\SWM3_9D92(6.20)\third_party\aes\aes.c 359Error while running C/C++ Compiler②错误原因:10、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\SWM3_9D92(6.20)\third_party\speex-1.2rc1\libspeex\arch.h 65Error while running C/C++ Compiler②错误原因:11、①错误描述:Error[Li005]: no definition for "ROM_SysCtlClockSet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\safertos_demo.o] Error[Li005]: no definition for "ROM_FlashUserGet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o]Error[Li005]: no definition for "ROM_IntPrioritySet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o]Error[Li005]: no definition for "ROM_GPIOPinTypeGPIOOutput" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Li005]: no definition for "ROM_GPIOPinWrite" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in<[0x20000000-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker②错误原因:12、①错误描述:Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in <[0x20000000-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker。
IAR620编译错误(五篇材料)
IAR620编译错误(五篇材料)第一篇:IAR 6 20编译错误IAR 6.20编译错误清单1、①错误描述:T ool Internal Error:Internal Error: [CoreUtil/General]: Access violation(0xc0000005)at 007588A5(reading from address 0x0) Internal Error: [CoreUtil/General]: Access violation(0xc0000005)at 007588A5(reading from address 0x0) Error while running C/C++ Compiler②错误原因:High配置设置为Size,应该为Low2、①错误描述:Fatal Error[Pe1696]: cannot open source file “inc/hw_types.h” E:StellarisWareM3_9D92boardsdk-lm3s9b96boot_demo2boot_demo2.c 25②错误原因:C/C++ Complier(Assember)->Preprocessor->Additional include directories: $PROJ_DIR$.$PROJ_DIR$..$PROJ_DIR$......3、①错误描述:Fatal Error[Pe1696]: cannot open source file“lwip/opt.h”E:StellarisWareM3_9D92utilslwiplib.h 44②错误原因:C/C++ Complier-(Assember)>Preprocessor->Additional include directories: $PROJ_DIR$......third_partylwip-1.3.2apps$PROJ_DIR$......third_partybget$PROJ_DIR$......third_partylwip-1.3.2portsstellarisinclude$PROJ_DIR$......third_partylwip-1.3.2srcinclude$PROJ_DIR$......third_partylwip-1.3.2srcincludeipv4$PROJ_DIR$......third_partylwip-1.3.2srcincludelwip$PROJ_DIR$......third_party4、①错误描述:Fatal Error[Pe035]: #error directive: Unrecognized COMPILER!E:StellarisWareM3_9D92boardsdk-lm3s9b96driversset_pinout.h 59Error while running C/C++ Compiler②错误原因:C/C++ Complier-(Assember)>Preprocessor->Defined symbols: ewarm5、①错误描述:Error[Pe020]: identifier “ROM_pvAESTable” is undefined E:StellarisWareM3_9D92third_partyaesaes.c 319②错误原因:6、①错误描述:Error[Li005]: no definition for “main” [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:定义函数:int main(void){ return(0);}7、①错误描述:Error[Li005]: no definition for “main” [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:如果是库是库函数,在:General Options->Output->Output file:选择: Library项4、①错误描述:Fatal Error[Pe1696]: cannot open source file “uip.h” E:StellarisWareM3_9D92third_partyuip-1.0appsdhcpcdhcpc.c 37②错误原因:5、①错误描述:②错误原因:$PROJ_DIR$......third_partylwip-1.3.2apps$PROJ_DIR$......third_partybget$PROJ_DIR$......third_partylwip-1.3.2portsstellarisinclude$PROJ_DIR$......third_partylwip-1.3.2srcinclude$PROJ_DIR$......third_partylwip-1.3.2srcincludeipv4$PROJ_DIR$......third_party$PROJ_DIR$......third_partyuip-1.0$PROJ_DIR$......third_partyuip-1.0uip$PROJ_DIR$......third_partyuip-1.0apps$PROJ_DIR$......third_partyspeex-1.2rc1include$PROJ_DIR$......third_partyspeex-1.2rc1includespeex$PROJ_DIR$......third_partyspeex-1.2rc1stellaris6、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:StellarisWareM3_9D92third_partyspeex-1.2rc1libspeexarch.h65②错误原因:7、①错误描述:Fatal Error[Pe035]: #error directive: “Unrecognized/undefined driver for DISK0!”E:StellarisWareM3_9D92third_partyfatfsportdual-disk-driver.c 62Error while running C/C++ Compiler②错误原因:UART_BUFFEREDDISK0_DK_LM3S9B96DISK1_USB_MSCINCLUDE_BGET_STATS8、①错误描述:Error[Pe020]: identifier “ROM_pvAESTable” is undefined E:SWM3_9D92(6.20)third_partyaesaes.c 359Error while running C/C++ Compiler②错误原因:10、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:SWM3_9D92(6.20)third_partyspeex-1.2rc1libspeexarch.h 6 5Error while running C/C++ Compiler②错误原因:11、①错误描述:Error[Li005]: no defini tion for “ROM_SysCtlClockSet” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjsafertos_demo.o] Error[Li005]: no definition for “ROM_FlashUserGet” [referenced fromE:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjlwip_task.o]E rror[Li005]: no definition for “ROM_IntPrioritySet” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjlwip_task.o]Error[Li005]: no definition for “ROM_GPIOPinTypeGPIOOutput” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjled_task.o]Error[Li005]: no definition for “ROM_GPIOPinWrite” [referenced from E:SWM3_9D92(6.20)boardsdk-lm3s9b96safertos_demoDebugObjled_task.o]Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytesin(total uncommitted space 0x10000).Error while running Linker②错误原因:12、①错误描述:Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in (total uncommitted space 0x10000).Error while running Linker第二篇:ccs编译错误(定稿)1、报错如下:-------------------------tam2012112701.pjt'./Debug/test0928.out' not built1._VECSTART 是由于我没有在程序中加入中断变量vectors.s55._rcv_hMcbsp_DMAId_hDmaRcv的解决办法是我将其在AD73360.C中原来是extern申明的,当我将其的extern声明去掉后,.out文件就输出成功了。
IAR 6 20编译错误
IAR 6.20编译错误清单1、①错误描述:Tool Internal Error:Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Internal Error: [CoreUtil/General]: Access violation (0xc0000005) at 007588A5 (reading from address 0x0)Error while running C/C++ Compiler②错误原因:High配置设置为Size,应该为Low2、①错误描述:Fatal Error[Pe1696]: cannot open source file "inc/hw_types.h" E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\boot_demo2\boot_demo2.c 25②错误原因:C/C++ Complier(Assember)->Preprocessor->Additional include directories:$PROJ_DIR$\.$PROJ_DIR$\..$PROJ_DIR$\..\..\..3、①错误描述:Fatal Error[Pe1696]: cannot open source file "lwip/opt.h"E:\StellarisWareM3_9D92\utils\lwiplib.h 44②错误原因:C/C++ Complier-(Assember)>Preprocessor->Additional include directories:$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\apps$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\ports\stellaris\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\ipv4$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\lwip$PROJ_DIR$\..\..\..\third_party4、①错误描述:Fatal Error[Pe035]: #error directive: Unrecognized COMPILER! E:\StellarisWareM3_9D92\boards\dk-lm3s9b96\drivers\set_pinout.h 59Error while running C/C++ Compiler②错误原因:C/C++ Complier-(Assember)>Preprocessor->Defined symbols: ewarm5、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\StellarisWareM3_9D92\third_party\aes\aes.c 319②错误原因:6、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:定义函数:int main(void) { return (0); }7、①错误描述:Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]Error while running Linker②错误原因:如果是库是库函数,在:General Options->Output->Output file:选择:Library项4、①错误描述:Fatal Error[Pe1696]: cannot open source file "uip.h" E:\StellarisWareM3_9D92\third_party\uip-1.0\apps\dhcpc\dhcpc.c 37②错误原因:5、①错误描述:②错误原因:$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\apps$PROJ_DIR$\..\..\..\third_party\bget$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\ports\stellaris\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include$PROJ_DIR$\..\..\..\third_party\lwip-1.3.2\src\include\ipv4$PROJ_DIR$\..\..\..\third_party$PROJ_DIR$\..\..\..\third_party\uip-1.0$PROJ_DIR$\..\..\..\third_party\uip-1.0\uip$PROJ_DIR$\..\..\..\third_party\uip-1.0\apps$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\include\speex$PROJ_DIR$\..\..\..\third_party\\speex-1.2rc1\stellaris6、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\StellarisWareM3_9D92\third_party\speex-1.2rc1\libspeex\arch.h 65②错误原因:7、①错误描述:Fatal Error[Pe035]: #error directive: "Unrecognized/undefined driver for DISK0!" E:\StellarisWareM3_9D92\third_party\fatfs\port\dual-disk-driver.c 62Error while running C/C++ Compiler②错误原因:UART_BUFFEREDDISK0_DK_LM3S9B96DISK1_USB_MSCINCLUDE_BGET_STATS8、①错误描述:Error[Pe020]: identifier "ROM_pvAESTable" is undefined E:\SWM3_9D92(6.20)\third_party\aes\aes.c 359Error while running C/C++ Compiler②错误原因:10、①错误描述:Fatal Error[Pe035]: #error directive: You now need to define either FIXED_POINT or FLOATING_POINT E:\SWM3_9D92(6.20)\third_party\speex-1.2rc1\libspeex\arch.h 65Error while running C/C++ Compiler②错误原因:11、①错误描述:Error[Li005]: no definition for "ROM_SysCtlClockSet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\safertos_demo.o] Error[Li005]: no definition for "ROM_FlashUserGet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o] Error[Li005]: no definition for "ROM_IntPrioritySet" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\lwip_task.o] Error[Li005]: no definition for "ROM_GPIOPinTypeGPIOOutput" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Li005]: no definition for "ROM_GPIOPinWrite" [referenced from E:\SWM3_9D92(6.20)\boards\dk-lm3s9b96\safertos_demo\Debug\Obj\led_task.o]Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in<[0x20000000-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker②错误原因:12、①错误描述:Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x11e54 bytes in <[0x20000000-0x2000ffff]> (total uncommitted space 0x10000).Error while running Linker。
IAR编译器的常见问题
IAR编译器的常见问题最近因为项目需要开始使用IAR for AVR,我用的是5.40版本的,主要是5.40以上才包括了aTtiny87,至于安装文件和和谐文件,大家自己找吧,很好找的。
1.编译报错如图所示:很显然你没有使能寄存器的位定义。
方法如下:Project ——> Option ——> General Options ——> System(如下图所示),勾选Enable bit definitions in I/O-Include files即可2.MCU型号选择如果和我一样都次都是以空工程创建的话,不过忘了第一步先进Project ——> Option ——> General Options ——> Target选择所使用的MCU型号,不然编译免不了要报错,如下图所示。
3. 堆栈大小今天下午编译一个程序,0错误0警告,挺好,可一运行就跑飞,根本不能正常运行。
其实是我没有正常设置堆栈大小导致的这种问题,尤其是在写大工程时,这种错误出现的概率很高。
GCC和IAR分配堆栈的方式不同,IAR先分配堆栈空间,相当于定义一个全局数组为堆栈空间,堆栈初始为堆栈空间最高地址;GCC不用先分配堆栈,自动把RAM剩余空间作为堆栈空间,堆栈初始为RAM最高地址。
先编译看看自己的程序用了多少ram,在看看总共有多少ram。
然后Project ——> Option ——> Linker ——> List选择生成LIST文件,并包含stack选项,如下图所示。
在./Debug/list目录下,得到.map(可能是.lst等其他格式)文件,用记事本打开,找到以下内容:***************************************** ** CALL GRAPH ** *****************************************->Sub-tree of type: Interrupt function tree that does not make: indirect callsCSTACK| Stack used (prev) : 0000000001 int_T0_OV| Stack used (prev) : 00000000| + function block : 0000000C......(省略N行)01 main| Stack used (prev) : 0000003A| + function block : 00000000<-Sub-tree of type: Function tree| Stack used : 000000E2找到最大的Stack used,我的就是000000E2,这就是用到的最大的堆栈空间,保守一点,我设置成0x100字节,没有超过剩余RAM,再重新编译,运行,仿真器没有堆栈不足警告,程序也能正常运行了。
IAR编译错误总结
IAR4.42A编译错误!请教!IAR中的error[27](2009-09-23 10:19:05)转载分类:嵌入式_etung标签:嵌入式_etungit发现IAR的链接器不允许在头文件中定义一个全局变量,然后有两个.c文件去引用。
而VC6.0就可以这样做。
所报错误示例为:Error[e27]: Entry "tagData" in module Wmmp ( E:\work\MiniFrame\PRJ\LED200_W4\IAR\Debug_in_flash\Obj\Wmmp.r79) redefined in module app ( E:\work\MiniFrame\PRJ\LED200_W4\IAR\Debug_in_flash\Obj\app.r79 )将头文件中变量前加上extern 后即不再报错。
程序编译时出现以下错误,实在不知道是什么原因,特向大家请教!Error[Pe223]: function "assert_param" declared implicitly E:\涡街流量计\设计\板2\程序\dft02\library\src\stm32f10x_nvic.c 351Error[Pa045]: function "assert_param" has no prototype E:\涡街流量计\设计\板2\程序\dft02\library\src\stm32f10x_rcc.c 500Error[Pe223]: function "assert_param" declared implicitly E:\涡街流量计\设计\板2\程序\dft02\library\src\stm32f10x_rcc.c 530第一你用了中文文件夹第二没有定义assert_param这个函数不太明白,assert_param函数在stm32f10x_conf.h中已经定义了。
IAR编译错误总结
IAR编译错误总结1. 错误:"undefined reference to"(未定义引用错误)解决方法:这种错误通常是由于函数或变量的定义缺失导致的。
可以检查一下函数或变量的定义是否正确,并确认是否包含正确的头文件。
2. 错误:"no such file or directory"(文件或目录不存在错误)解决方法:这种错误通常是由于指定的文件或目录不存在而导致的。
可以检查一下路径是否正确,并确认文件或目录是否存在。
3. 错误:"multiple definition of"(多重定义错误)解决方法:这种错误通常是由于同一个函数或变量在多个源文件中被定义而导致的。
可以通过在定义函数或变量的地方加上关键字 "extern"来解决这个问题。
4. 错误:"expected ';' before"(在之前缺少分号错误)解决方法:这种错误通常是由于在行代码中缺少了分号导致的。
可以检查一下代码,并确保每一行的末尾都有分号。
5. 错误:"syntax error"(语法错误)解决方法:这种错误通常是由于书写的代码有语法错误导致的。
可以仔细检查代码,并确保每个语法元素(如括号、引号等)都是成对出现的。
6. 错误:"cannot open source file"(无法打开源文件错误)解决方法:这种错误通常是由于指定的源文件无法被找到或打开而导致的。
可以检查一下路径是否正确,并确认源文件是否存在。
7. 错误:"too few arguments to function"(函数参数数量过少错误)解决方法:这种错误通常是由于调用函数时传递的参数数量少于函数定义时所需的参数数量导致的。
可以检查一下函数调用处的参数数量,并确保和函数定义处的参数数量一致。
IAR6.3版本编译出错问题解决
__intrinsic signed long __QDOUBLE( signed long );
__intrinsic int
__QFlag( void );
__intrinsic signed long __SMUL( signed short, signed short );
/* Architecture v6, REV and REVSH are also available in thumb mode */ __intrinsic unsigned long __REV( unsigned long ); __intrinsic signed long __REVSH( short );
#pragma language=save #pragma language=extended
__intrinsic void __no_operation(void);
__intrinsic void __intrinsic void
__disable_interrupt(void); __enable_interrupt(void);
__intrinsic void __STC2L_noidx( __cpid coproc, __cpreg CRn, __ul *dst, unsigned __constrange(0,255) option);
/* Status register access */
__intrinsic unsigned long __get_CPSR( void );
/* Load coprocessor register (noindexed version with coprocessor option). */ __intrinsic void __LDC_noidx( __cpid coproc, __cpreg CRn, __ul const *src,
IAR软件应用中的错误提示及解决方法(7页)
IAR软件应用中的错误提示及解决方法1、Q:Error[e16]: Segment XDATA_Z (size: 0x19a1 align: 0) is too long for seg ment definition. At least 0xe4c more bytes needed. The problem occurre d while processing the segment placement command "-Z(XDATA)XDATA_ N,XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END", where at the mo ment of placement the available memory ranges were "XDATA:f1ff-fd53" Reserved ranges relevant to this placement:XDATA:f000-f1fe XSTACKXDATA:f1ff-fd53 XDATA_NBIT:0-7 BREGBIT:80-97 SFR_ANBIT:a8-af SFR_ANBIT:b8-c7 SFR_ANBIT:d8-df SFR_ANBIT:e8-ef SFR_ANA:其实这个问题并不是你的程序本身有问题,主要是因为你编写的程序太大了,超出了芯片本身的定义。
今天在群里学习了一招,就是将数组定义到code里,我们看一下例子。
我们定义一个5100个元素的数组,有以下两种方法:mermaid提出的方法是:typedef unsigned char const __code INT8U;extern INT8U shuzi[5100];文晶提出的方法是INT8U code shuzi[5100];这两种方法其实效果是一致的,定义完数组之后,调用的部分就是需要用指针来调用数组里面的数值了。
IAR因版本不兼容打不开工程文件解决
本文给出IAR因版本不兼容打不开IAR工作区遇到的各种问题及解决方法,包括依据提示修改版本,删除未知名称(ewp文件)。
若还没解决,则创建新工作区、工程,并拷贝相关文件,我想这是一种通用化的解决方法(很诡异)。
PS:本文以IAR工程项目ContikiCC2530Port为例,IAR for MCS-51版本是7.51A。
本文记录了整个调试过程,实际场景,不妨先跳到第三部分,看行不行,不行的话,再按第二部分修改。
一、IAR错误提示昨天,在GitHub下载了一个IAR工程项目ContikiCC2530Port,打开*.eww文件出现一系列错误,如下:1.1 Broken options were detected in the project file.A backup copy will be made.图1 IAR警告Broken options1.2 The project file * was created by a newer version of project and cannot be opened图2 IAR警告created by a newer version1.3 The project * could not be open图3 IAR警告could not be openBuild区域显示如下信息:LOAD: Configuration 'ContikiBankedRelease' in the project 'ContikiCC253xProj' contains broken options for tool 'General': The format of this file is not supported by this version of the workbench.It appears to have been written by a newer version of the workbench. Diagnostics: 'Settings 'General': unsupported version - '.Options for 'General' will be set to default. Creating backup of original project file.LOAD: Configuration 'ContikiBankedRelease' in the project 'ContikiCC253xProj' contains broken options for tool 'ICC8051': (Registry: unknown name: CompilerMisraRules04)Options for 'ICC8051' will be set to default.LOAD: Configuration 'ContikiBankedRelease' in the project 'ContikiCC253xProj' contains broken options for tool 'XLINK': The format of this file is not supported by this version of the workbench. It appears to have been written by a newer version of the workbench.Diagnostics: 'Settings 'XLINK': unsupported version - '.Options for 'XLINK' will be set to default.如下图所示:图4 IAR log windows信息初步断定,这些警告是因为IAR版本不兼容引起的,但事实上没那么简单,之前也遇见用新版本IAR打开旧版本IAR工程文件,可以直接打开(给出提示信息),在这里还涉及到工程项目配置。
IAR编译错误
IAR4.42A编译错误!请教!程序编译时出现以下错误,实在不知道是什么原因,特向大家请教!Error[Pe223]: function "assert_param" declared implicitly E:\涡街流量计\设计\板2\程序\dft02\library\src\stm32f10x_nvic.c 351Error[Pa045]: function "assert_param" has no prototype E:\涡街流量计\设计\板2\程序\dft02\library\src\stm32f10x_rcc.c 500Error[Pe223]: function "assert_param" declared implicitly E:\涡街流量计\设计\板2\程序\dft02\library\src\stm32f10x_rcc.c 530第一你用了中文文件夹第二没有定义assert_param这个函数不太明白,assert_param函数在stm32f10x_conf.h中已经定义了。
stm32f10x_conf.h已加到workplace里了。
还有文件夹用中文对程序有影响吗?库文件版本混乱,估计用错IARv5的文件了.库文件版本混乱,估计用错IARv5的文件了.Error[Pe020]: identifier "RCC_APB2Periph_GPIOC" is undefined查看是否包含了头文件:#include "stm32f10x_rcc.h"想改STM32F10X_MD为STM32F10X_HD,但是IAR530就是编译startup_stm32f10x_md.s文件,何解??想改STM32F10X_MD为STM32F10X_HD,但是IAR530就是编译startup_stm32f10x_md.s文件,何解??编译那个文件和这个宏定义无关,你应该把STM32F10X_HD.s文件添加到你的工程中,并把startup_stm32f10x_md.s从工程中删除或设为不编译才行请问下,IAR编译出现这个错误Error[Li005]: no definition for "__program_start" [referenced fromF:\sd\WORM_SD_MMC1\WORM_SD_MMC\Debug\Obj\stm32f10x_vector.o],这是我在做实验时出现的错误,有时候从别的地方拷贝个stm32f10x_vector.o覆盖掉原来的就可以,有时就不行,怎么回事呢这是?再有,我想把一个数组定义在程序空间,在IAR环境下如何做呢?我用原来的 u8 code shuzu[]的方式怎么不行呢?把code删掉就可以,忘各位高手解答下。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
TN0830Technical noteHow to use EWARM 6.2x with projects built with EWARM 6.1 and previous versionsIntroductionSince EWARM version 6.2, the compiler adds new intrinsics for the CMSIS library thatimprove the compiler performance in terms of optimization. These intrinsics may breakCMSIS header files included in STM32 firmware packages built with older EWARMversions.To be in line with this change, this technical note describes the steps required to useEWARM 6.2x with projects built with EWARM 6.1 and previous versions.October 2011Doc ID 022329 Rev 11/6Contents TN0830 Contents1Opening previous EWARM projects with EWARM 6.2 . . . . . . . . . . . . . . 3 2Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52/6Doc ID 022329 Rev 11 Opening previous EWARM projects with EWARM 6.2When using EWARM 6.2x to open projects built with EWARM 6.1 and previous, thefollowing compilation errors are generated due to double CMSIS definitions:Error[Pe147]: declaration is incompatible with "__interwork__softfp unsigned long __get_PSP(void)" (declared at line 52 of"C:\Program Files\IARC:\Libraries\CMSIS\CM3\CoreSupport\core_cm3.hTo overcome this issue:1.Check the "Use CMSIS" option from Project options > General Options > LibraryConfiguration:Figure e CMSIS option2. Remove all CMSIS header files from your project by removing:“$PROJ_DIR$\..\..\..\Libraries\CMSIS\CM3\CoreSupport” from [Project>Options>C/C++Compiler>Preprocessor]Doc ID 022329 Rev 13/6Figure 2.Remove all CMSIS header files from your project4/6Doc ID 022329 Rev 1TN0830Revision history Doc ID 022329 Rev 15/62 Revision historyTable 1.Document revision history DateRevision Changes20-Oct-20111Initial release.TN0830Please Read Carefully:Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice.All ST products are sold pursuant to ST’s terms and conditions of sale.Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein.No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXP RESS OR IMP LIED WARRANTY WITH RESP ECT TO THE USE AND/OR SALE OF ST P RODUCTS INCLUDING WITHOUT LIMITATION IMP LIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXP RESSLY AP P ROVED IN WRITING BY TWO AUTHORIZED ST REP RESENTATIVES, ST P RODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST.ST and the ST logo are trademarks or registered trademarks of ST in various countries.Information in this document supersedes and replaces all information previously supplied.The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.© 2011 STMicroelectronics - All rights reservedSTMicroelectronics group of companiesAustralia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America6/6Doc ID 022329 Rev 1。