IAR for ARM 工程模版不兼容修改方法
本文章是基于最新版IAR for ARM V8.10的,但是对于低版本步骤大同小异也可参考本文。
在打开一些网上下载的IAR工程时经常会遇到很多兼容问题,下面来一一解决:
一.Fatal Error[Pe1696]: cannot open source file "core_cm3.h"
解决办法:1.Remove 工程中的“core_cm3.c”,并且点到Workspace最上层的Project -xxx处
2.Project->Option->General Option->Library Configration->勾上右下角的Use CMSIS
3.点OK再Make一下,这里就不会再报错了。
二. Warning[25]: Label 'xxxxx' is defined pubweak in a section implicitly
declared root
例如:Warning[25]: Label 'Reset_Handler' is defined pubweak in a section implicitly declared root C:\Users\Administrator\Desktop\STM32F10x 工程模板-IAR\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_md_vl.s
137
Warning[25]: Label 'NMI_Handler' is defined pubweak in a section implicitly declared root C:\Users\Administrator\Desktop\STM32F10x 工程模板-IAR\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_md_vl.s
145
Warning[25]: Label 'HardFault_Handler' is defined pubweak in a section implicitly declared root C:\Users\Administrator\Desktop\STM32F10x 工程模板-IAR\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_md_vl.s
150
解决办法:1.找到工程文件夹中的startup_stm32f10x_md_vl.s并打开(不同芯片此处的.s文件不同,按照报错提示打开相应文件)
2.在所有SECTION .text:CODE:REORDER(1)的“REORDER”和“(1)"之间加入”NOBOOT“,如图:
全部修改完成后Make一下这个warning就没了。
大致会碰到上述两个主要版本兼容问题。还有就是头文件路径别忘添加,否则也会报错,诸如:Fatal Error[Pe1696]: cannot open source file "***.h",头文件添加方法网上很好找 。
以下是我自用的工程模板:http://download.****.net/download/baidu_35113561/9930859