IAR Eclipse Setup Guide Part 2 — Managed Build Project

A PDF version of this guide, including project setup and debugging is available in the Documentation section

This guide is aimed at IAR Embedded Workbench users who are interested in integrating the IAR tools within Eclipse. For instructions relating to integrating GCC within Eclipse see this guide.

This is part 2 of a series of step-by-step guide on setting up and using the IAR Embedded Workbench within the Eclipse IDE. Using the tools installed in part 1 this article will guide the reader on how to create a C/C++ managed build project within Eclipse using the IAR Eclipse Plugin. Future articles will deal with creating a Makefile project and also how to create a debug configuration.

Managed Build Project vs Makefile Project

Broadly speaking there are two types of projects that can be created with IAR Eclipse. The first is a managed build project where the IDE is responsible for the various build steps. The second is a Makefile project where the user is responsible for providing a suitable Makefile to perform the building and linking of the project source code. The latter is discussed in a later article while this article goes over the steps necessary to create a managed build project. Note that these instructions are generic and the steps required may be slightly different depending on the target platforms.

Managed Build Project

After having opened Eclipse with a suitable workspace as discussed in the previous article, creating a new managed build project can be accomplished first by invoking the “File->New->C/C++ Project” menu item.

Eclipse "File" menu with the "New C/C++ Project" menu item highlighted.
Create New C/C++ Project menu item

This should open the “New C/C++ Project” dialog.

New C/C++ project dialog showing a list of possible project types with the "C Managed Build" project type highlighted.
New C/C++ Project dialog

Select “C Managed Build” and then click the “Next” button.

Create new C project of selected type dialog. Two text boxes with a browse button are available to set the name and install directory of the new project. The bottom left panel contains a series of supported types with the "Empty Project" type under the "Executable (IAR)" category selected and highlighted. The bottom right panel lists the compatible toolchains available for the selected project type.
New project name and type selection

In this next panel, the project name and type must be selected. First enter the desired project name. Then select the “Empty Project” item from under the “Executable (IAR)” category. Next, make sure that the “IAR Toolchain for ARM – (8.x)” option is selected unless you are using an older, legacy version of the IAR toolchain.

Click “Next” to continue with the wizard. Note that it is possible to exit the wizard by clicking “Finish” but this will skip the device selection step.

New project build configuration panel with the default "Debug" and "Release" configurations displayed.
New project build configurations

This next panel shows the build configurations for the project to be created. For the purpose of this guide, it is recommended to keep the default values.

Click “Next” yet again to continue further to the device selection dialog.

New project device selection dialog with Browse button to select the MCU or SoC to use for the new project. The Cortex-A7 core of the NXP i.MX7 is selected in the screenshot for the purpose of the example.
IAR Device Selection dialog

In the device selection dialog select the target device for the new project. This example uses the A7 core of the NXP i.MX7 SoC but any of the supported targets can be used.

Click “Finish” to exit the wizard and create the project. The newly created project should appear in the workspace on the left panel of the IDE.

To demonstrate building and debugging this example uses an empty main function.

Eclipse New File context menu item.
Add new file to project context menu item


To add the example file to the project right-click on the project root in the workspace and select “New->File”. This opens the new file dialog.

Create new file dialog. The top section contains a project tree to select the location of the new file in the selected project. At the bottom a text box is used to set the name of the file to create.
Create new file dialog

Name the new file main.c and click “Finish”.

Empty main function

The new file is now showing in the project and should be open in the IDE. Type the following empty function into the newly created file before continuing.

void main(void)
{
    for(;;) {

    }
}
"Build Project" context menu item.
Build project context menu item

Now right-click again on the root of the project and select “Build Project”. This should start building the project. Note that you might get errors if a valid IAR licence isn’t available for the IAR toolchain. See the previous sections on how to request an evaluation licence.

Eclipse IDE with console output of the build process showing a successfull build
Example project built

Before long the project should be built and is now ready to be loaded to a target for debugging.

With this the project is now ready to be loaded on a target and debugged. Check out part 3 for instructions on how to create a Makefile project using the IAR Eclipse Plugin or part 4 for information on creating a debug configuration.

Visit the Documentation section for a PDF version of this guide including project and debugging setup.


See all articles