I recently started exploring STM32 and began working on a program using IAR a few days ago. I quickly realized that many online tutorials are outdated and not compatible with the latest version of IAR. As a result, I faced numerous challenges along the way, and each issue had to be resolved on my own. With the help of some helpful online communities, I eventually managed to successfully set up my first project. Now, I’m sharing my experience with you in the IAR environment, hoping it can assist you in overcoming similar difficulties.
I'm currently using IAR version 5.3 along with the STM32 Firmware Library version 3.0 (note that versions 3.0 and above are generally similar). The first step is to create a folder where all project-related files will be stored. Then, copy the STM32 firmware libraries provided by ST into this folder. Also, create a file named "project" and a text document called "readme" for reference.
Next, open the project and copy four essential files into the folder—these can be found in any standard STM32 example code. Then, create a new folder named "EWARMv5," as shown in the image.
Inside the "EWARMv5" folder, copy six more files, which are also available in any STM32 example. Once this is done, open IAR and select "Empty Project" from the menu. A new window will appear where you can save your project.
Choose the "EWARMv5" folder you created earlier, give your project a name like "LED," and click "Save." Then, add groups and files as shown in the image. You can drag and drop the necessary files into the project structure.
Right-click on the project name and select "Options" to configure settings. In the "Output File" section, IAR will automatically generate the output. Under "CMSIS," you'll find the core files for the Cortex-M3. The "EVAL" folder contains files for peripherals like buttons and serial ports. The "Startup" folder includes the startup file based on the chip's flash size (e.g., STM32F10x_LD for low-density devices).
The "Fwlib" folder contains the peripheral .c files needed for your program. When setting up the project, make sure to select the correct microcontroller model. Add include paths such as:
- $PROJ_DIR$\..
- $PROJ_DIR$\..\..\Libraries\CMSIS\CM3\CoreSupport
- $PROJ_DIR$\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x
- $PROJ_DIR$\..\..\Libraries\STM32F10x_StdPeriph_Driver\inc
- $PROJ_DIR$\..\..\..\Utilities\STM32_EVAL
- $PROJ_DIR$\..\..\..\Utilities\STM32_EVAL\Common
- $PROJ_DIR$\..\..\..\Utilities\STM32_EVAL\STM3210E_EVAL
Also, define macros like USE_STDPERIPH_DRIVER to indicate that the peripheral library is being used, STM32F10X_HD for high-density chips, and USE_STM3210E_EVAL if you're using the STM3210E-EVAL board.
This setup should help you get started with your STM32 project in IAR. If you encounter any issues, feel free to ask—I'm still learning too!
round Installation Antenna,Gy06 Military Green Log Periodic Antenna,Gy06 Military Green Antenna Internal Antenna
Mianyang Ouxun Information Industry Co., Ltd , https://www.ouxunantenna.com