Detailed introduction to the installation, registration, new project and configuration process of IAR9.30 and above

1. A brief introduction to IAR

IAR generally refers to an integrated development environment for embedded software, similar to MDK-Keil. IAR's official website:

https://www.iar.com/

IAR corresponds to different IAR software for different core processors. So far, IAR supports most MCUs, such as 8051 series, ARM architecture series, MSP430 series, AVR series, etc., which are commonly used chip architectures.

For ARM architecture chips, there is a corresponding IAR Embedded Workbench for ARM software platform, because I mainly use ARM architecture chips, the following installation, registration and use are all introduced based on this version.

2. IAR9.30 version installation and registration

So far, IAR for ARM has been updated to version 9.30 and above. We can download the latest version from the IAR official website, as follows:

[https://www.iar.com/products/architectures/arm/iar-embedded-workbench-for-arm/]

Or use the link provided by my Baidu Netdisk below to download, it is the same software, which also contains the registration tool of IAR9.30 or above.

The installation process is actually very simple, just keep the default options all the way to next, I won’t introduce much here, or refer to the following article for installation (refer to this article to register versions above 9.30 is unsuccessful, and you need a few other steps).

https://strongerhuang.blog.csdn.net/article/details/52562533

The registration process is described in detail :

IAR is a dedicated paid software, the registration method introduced here is only for learning, not for commercial use.

1. Open the IAR EW for ARM software and enter the License Manager management menu.

After the installation is complete, there is no shortcut to the IAR software on the desktop. You can find the IAR EW for ARM software in the start menu, and then open it ( note : open it as an administrator). Opening it for the first time may automatically pop up the License registration interface, let's ignore it, click cancel, and then close.

insert image description here

2. Select the activation method, here we choose offline active (that is, the offline activation method).

insert image description here

Then select the Offline mode, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-wjU2DXDn-1664116233810)(../picture/image-20220925140402837.png)]

3. Open the registration machine as an administrator and generate a registration code.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-GKKz9b6c-1664116233810)(../picture/image-20220925140728749.png)]

4. Copy the registration code to the activation software

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-qJEav5iU-1664116233810)(../picture/image-20220925140929460.png)]

5. Choose not to lock, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-GqKsJJtc-1664116233811)(../picture/image-20220925141017832.png)]

6. Save the generated activation information file to our installation directory, and then click Next.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-T2YRvCLP-1664116233812)(../picture/image-20220925141350640.png)]
7. To request the activation information file, just click the next page.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-NZD9dTvE-1664116233812)(../picture/image-20220925141639476.png)]

8. At this time, we need to go to the registration machine again to generate the activation information file.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-FKvtAvk5-1664116233812)(../picture/image-20220925142318857.png)]

9. Go back to the License Management Wizard interface, and then select the activation information file that we just generated using the registration machine.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-dXkNyXj6-1664116233813)(../picture/image-20220925142536639.png)]

10. After clicking Next, the Done interface will appear. We can click Done directly to complete the registration.

11. If it is a previous version, the registration may be successful here, but I found that the registration status does not display OK, but a prompt: the generation feature is not of version 18 This message indicates that the registration has not been successful. At this time we also need to run a small tool, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-nXwVIDVn-1664116233813)(../picture/image-20220925143055602.png)]

Close the IAR software first, and then copy the above tool software to the following three installation directories of IAR:

run licpatcher64.exe from directories:
C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\
C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\jet\bin\
C:\Program Files\IAR Systems\Embedded Workbench 9.0\common\bin\

In these three directories, run the tool software licpatcher64a.exe once.

12. Open the IAR for ARM software again to confirm whether the registration is successful.

Enter the License Manager management interface, if the registration status is as follows, it means the registration is successful.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-U66IuXrb-1664116233814)(../picture/image-20220925143625915.png)]

3. Create the IAR project of STM32F407

First go to ST's official website to download a standard peripheral driver library for STM32F4 (chip models after F4, it seems that there is no firmware library, only the HAL library), as follows:

https://www.st.com/zh/embedded-software/stm32-standard-peripheral-libraries.html

Select F4 to download.

3.1 Prepare the file directory that needs to create the IAR project

1. We first create the following file directories in a certain directory:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-f4hHybLt-1664116233814)(../picture/image-20220925154334183.png)]

2. Then, we copy the downloaded STM32F4 firmware library to the corresponding project directory.

Among them, the CMSIS directory mainly stores the files related to the M4 chip architecture. We copy all the relevant files in the CMSIS directory of the firmware library to it, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-7kk5he0z-1664116233814)(../picture/image-20220925154750468.png)]

Then copy the files in the standard firmware library directory. We can copy all the .c and .h files to our corresponding directories, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-yENtH6ke-1664116233815)(../picture/image-20220925154929452.png)]

3. In the User directory, we can create a main.c file first, and the code in it can not be implemented first.

3.2 Create Workspace and Project

1. Create a workspace first, File -> New Workspace

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-a65NMfQv-1664116233815)(../picture/image-20220925155159806.png)]

2. Then create a new project, Project -> Create New Project

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-EIlZQoo3-1664116233815)(../picture/image-20220925155509400.png)]

Click OK, and then select the directory to save the project. We save it in the file directory we just prepared, and then name the project as STM32F407_Project, and then save it.

3.3 IAR add files and file groups

1. Click on the project, then right-click, and choose to add three file groups with ours in the windows directory, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-AxCu4rvK-1664116233816)(../picture/image-20220925160542211.png)]

2. Then, add the corresponding .c file in each directory group, add CMSIS, standard firmware library, and main.c file in the User directory in turn, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-SokHfNNR-1664116233816)(../picture/image-20220925160942841.png)]

4. Basic configuration of IAR project

4.1 Configure the kernel and chip model

Click on the project, then right click and select the Options... option.

Then configure the chip core and model, as shown below:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-E3TYnUac-1664116233817)(../picture/image-20220925163519380.png)]

4.2 Configure header file include path

C/C++ Compiler -> preprocessor, and then add the header file directory we need inside, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-1TkKI83s-1664116233817)(../picture/image-20220925165422038.png)]

4.3 Add the required macro definition in the Options configuration

C/C++ Compiler -> preprocessor, and then add the macro definitions that need to be defined in the Define symbols column, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-EGlvvsa5-1664116233817)(../picture/image-20220925170000878.png)]

4.4 Link script configuration

IAR software uses the .icf file for management when linking the code. If we need to use our own link script file, then we can choose the .icf file we wrote.

If you need to modify it, then select Linker -> Config, and then select your own link script .icf file.

But here we do not need to customize the .icf link script file, we can use the .icf file that comes with the software (if your chip model is not in IAR, then you can provide the .icf file yourself).

4.5 Select debugger and related configuration

1. Select the J-Link debugger, Debugger -> Setup, as shown below:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-BXuv8PK7-1664116233818)(../picture/image-20220925172042054.png)]

2. Then select the interface corresponding to J-Link, whether the development board is SWD or JTAG interface mode, my development board is JTAG interface, so choose JATG interface mode, as follows:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-cJLS7QNd-1664116233818)(../picture/image-20220925172349301.png)]

4.6 Configure whether to use some library functions that come with IAR software

If you need to use some standard library function interfaces (such as the printf and scanf we use), then the library needs to select the Full type, as shown in the figure below.

In addition, there are differences between IAR for ARM versions V5, V6, and V7. This is the reason why many people compile previous projects with the new version of IAR and have errors. Therefore, when we use the new version of IAR software, we need to check Use CMSIS (meaning Microcontroller Software Interface Standard). As shown below.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-n4ZvV8MQ-1664116233818)(../picture/image-20220925215859578.png)]

5. Compile and download the program

After some basic configuration above, you can compile and download the program.

First of all, in the main function, I write a simple function to realize the LED water light effect on the development board. Then you can compile and download.

5.1 Compiler

To compile the program, you can directly press F7, or Ctrl + F7, or rebuild the entire program, as shown below:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-kIW6tb8O-1664116233819)(../picture/image-20220925221231660.png)]

5.2 Download program

Since I am a novice and not familiar with IAR, I only found the way to download the program and debug together, which is the Download and debug button in the shortcut menu. After searching for a long time, I found out that I can download the program directly without debugging.

1. First, check the Use flash loader option

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-XE06BJfF-1664116233819)(../picture/image-20220925221544145.png)]

2. After J-Link downloads the program, choose the reset method, Reset Pin mode, so that after downloading the program, it can run without receiving a reset. Anyway, I found that this is the solution. I don’t know if other friends have found other solutions. Welcome to leave a message to discuss.

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-xrfV4xIa-1664116233819)(../picture/image-20220925222244882.png)]

After completing the above configuration, you can download the program to Flash. If we don’t need to debug, click Project -> Download -> Download active application to download the program. This can be directly downloaded to Flash without debugging.

IAR software and other tools Baidu network disk link:

Link: https://pan.baidu.com/s/1wVjJAf760TfTmZSQAby00Q
Extraction code: 7os1

Guess you like

Origin blog.csdn.net/luobeihai/article/details/127044565
Recommended