Author: Instructor Zhu,Hua Qing vision embedded college lecturer.
Some time ago, I wrote the ZigBee source code and used the IAR tool to sort out and summarize the installation and configuration of IAR.
I:IARIntroduction
1. IAR embedded workbench (EW) is an embedded integrated development environment developed by IAR systems.
2. Ew includes: Embedded C/C ++ optimized compiler, assembler, connection locator, library administrator, editor, project manager and C-SPY debugger.
Ii. Installation of IAR
1. When you install autorun.exe in a single way, you will see the 2.1 interface:
Fig 2.1
2. Select "Install IAR embedded workbench" to go to the installation page. 2.2:
Fig 2.2
3. Click "Next" to next. Your name, company, and authentication sequence are required, as shown in Figure 2.3.
Fig 2.3
4、run keygen.exe with the generation sequence number of the registration machine, as shown in 2.4:
Fig 2.4
5. After filling in the correct information, click "Next" to next. The sequence key generated by your computer's machine code and authentication sequence will be displayed, as shown in Figure 2.5.
Fig 2.5
6. After the input authentication sequence and sequence key are correct, click "Next" to next. As shown in Figure 2.6, you will choose full installation or typical installation. Here we choose 1st, that is, full installation.
Fig 2.6
7. Click "Next" to next. Here you will check whether the information you entered is correct, as shown in Figure 2.7. If you want to modify the settings, click back to modify the settings.
Fig 2.7
8. Click "Next" to start installation, as shown in Figure 2.8. Here you will see the installation progress, which will take several minutes to wait, and now you need to be patient.
Fig 2.8
9. When the Progress reaches 100%, it will jump to the next interface, as shown in Figure 2.9. Here you can choose to view the IAR introduction and whether to run the IAR development integration environment immediately. Click Finish to complete the installation.
Fig 2.9
10. After installation, you can find the newly installed IAR software from "start", as shown in Figure 2.10.
Fig 2.10
Now you can start your IAR software development environment by selecting a program in the desktop shortcut or by clicking "start.
Now we have completed the installation of IAR.
3. Edit the IAR Project
1. Use the IAR development environment to create a new workspace. You can create one or more projects in a workspace. Generally, the 3.1 window is displayed. You can choose to open the recently used workspace or add a new project to the current workspace.
Fig 3.1
2. Select "cancel" in the pop-up interface and select "file \ new \ workspace. Now that you have created a workspace, you can create a project and put it in the workspace. Open an existing workspace
Fig 3.2
3. Select iotest.
Fig 3.3
4. Add a file
Fig 3.4
Click Save.
4. Create a project and program file
1.1 create a workspace
Fig 4.1
2. Create a project
Fig 4.2
3. Select 8051 in the pop-up dialog box
Fig 4.3
4. Save it in the specified folder
Fig 4.4
5. Add source program files
Fig 4.5
6. Save the source program file as 11.c.
Fig 4.6
7. Add the source program to the project.
Select 11.c
Fig 4.7
8. Click Save to view the style of the workspace area on the left.
Fig 4.8
In the preceding blank file, you can write the source code you want and click Save.
5. Set engineering parameters
1. select the option in "project,
Fig 5.1
2. General options items
2.1 Under the target tab, select "C: \ Program Files \ IAR systems \ embedded workbench 5.3 \ 8051 \ config \ devices \ Texas Instruments" under the device bar. (based on your IAR installation directory)
Fig 5.2
2.2 Data Pointer label
Fig 5.3
2.3. Stack/heap label. set it to "0x1ff" in the xdata column ".
Fig 5.4
3. linker item
3.1 output Tag:
Fig 5.5
Note: If you need to generate a. HEX file for the smartrf flash programmer to write, you need to check "other" in the format option. As shown in:
Fig 5.6
3.2 config label: Set the linker command file column, check "override defalt", and set it to "$ proj_dir $ \ .. \ tools \ cc2530db \ f8w2530. xcl"
Fig 5.7
4. Set the driver column to "Texas Instruments" under the "Debugger item setup" tab ".
Fig 5.8
Click the OK key at the bottom of the menu to complete parameter settings. Next, you can compile and debug the program.
6. Compilation and Connection
1. Compile and press the function key "F7" or click the toolbar icon. The workspace save page is displayed.
Fig 6.1
2. Set the workspace name and click "save" to start compilation. The compilation information is displayed at the bottom of the screen, including warnnig and error. The compilation information display program has an error:
Fig 6.2
3. At the same time, the source program file interface is marked with a red cross symbol:
Fig 6.3
4. Modify the source program and re-compile the program according to the prompts. The prompt is as follows:
Fig 6.4
VII. program download and debugging:
1. After the program is compiled, you can download it to the target board for simulation. Click or press Ctrl + D to load the program. If no simulator is connected or the simulation board is poorly connected at this time, the following interface will pop up:
Fig 7.1
2. Check and reset the simulator. Click again. a progress bar is displayed, indicating that the program is being downloaded. After the program is completed, the debug toolbar is displayed.
You can debug the program. The buttons in the Progress toolbar are as follows:
Reset button, target board back to program start point
Break button
Step over button
Step into button
Step out button
Next statement button
Run to cursor button
Go button
Stop debugging button
Source: Huaqing vision embedded Linux training network, the original article address: http://www.embedu.org/Column/Column680.htm. (For more information, see the source)