IAR环境搭建注意点

1. include文件添加

Options->C/C++ Compiler 中的Preprocessor中增加一般的头文件

同时 在Assembler中的Preprocessor标签下添加$PROJ_DIR$..路径,因为在会变文件中有对FreeRTOSConfig.h文件的引用。

2. 需要增加设置MCU型号,要不然会出现 编译器似乎无法识别__DSB

在 Options->General Options->Target

3. Assembler中需要添加FreeRTOSConfig.h头文件路径

4.  IAR是默认添加C Lib库的

5. 工厂生产BIN文件

6. 工程生产mip文件

通过MAP文件可以查看到该程序需要多大的 memory.

表明,该程序运行需要9k的memory. 5298是flash, 9668是ram

7. 需要加入宏文件,要不然会出错

Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" STM32sorceCodeST_freeRTOScomponentsocstm32f103zecmsisdevicestm32f10x.h 96

如图加入:

USE_STDPERIPH_DRIVER ; USE_STDPERIPH_DRIVER  STM32F10X_HD

USE_HAL_DRIVER          STM32F030x8

原文地址:https://www.cnblogs.com/maxpak/p/8308629.html