IAR 编译报错 Fatal Error[Pe1696]: cannot open source file "stm32_eval.h"

首先在STM32F10x_StdPeriph_Lib_V3.5.0\Utilities中找到STM32_EVAL文件夹,将其添加到工程包含目录中。

然后,在遇到

Fatal Error[Pe035]: #error directive: "Please select first the STM32 EVAL board to be used (in stm32_eval.h)" 时,

此为一个软件陷阱,打开stm32_eval.h文件,找到下图中的位置:

IAR 编译报错 Fatal Error[Pe1696]: cannot open source file "stm32_eval.h"

然后取消IAR 编译报错 Fatal Error[Pe1696]: cannot open source file "stm32_eval.h"中的一个注释即可