IAR升级之后,打开stm32官方例程,编译时提示如下错误:

Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned short __LDREXH(unsigned short const E:\My doc\STM32F10x标准库v3.5.0\STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h 1154

Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned short __LDREXH(unsigned short const  E:\My doc\03 - 专题\STM32F10x标准库v3.5.0\STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h 1154 

解决办法:

1,在Project -> Options -> C/C++ Compiler-> Preprocessor -> Additional include directories 头文件路径里面,把包含core_cm3.h的路径删除。

2,在Project -> Options -> General Options -> Library Configuration -> Use CMSIS,右下角的选项中选择 use CMSIS

05-02 14:30