Skip to main content

IAR Embedded Workbench

This section is a guide to open, build and debug an example application from the SDK using IAR Embedded Workbench. It is assumed that you have this development environment installed on your computer.

Install the SDK

Unpack the SDK zip file that was downloaded in the Download the SDK section somewhere on the local file system. It is suggested to use a very short path as the SDK has a deep folder structure and a too long path can cause problem in Windows.

The folder that the SDK is unpacked into will be referred to as <install_dir> in the following sections.

Build an Example Application

The following steps will guide you through opening the hello_world application for the Cortex-M7 core of the iMX RT1176. These steps may change slightly for other example applications as some of these applications may have additional layers of folders in their path. Note that the IAR Embedded Workbench workspace files are always placed in subfolders named iar/ so look for that.

  1. Open the desired example application either by double clicking the .eww file in the explorer or by starting IAR Embedded Workbench and selecting File Open Workspace... from the menu. The hello world example has this path:

    <install_dir>boards/evkmimxrt1170/demo_apps/hello_world/cm7/iar/hello_world_demo_cm7.eww

  2. Customize the project. For projects using a display this includes selecting which display to use, for networking projects it may include setting the IP number/netmask, for Wi-Fi projects it includes selecting which M.2 module to use and which Wi-Fi network to connect to.

    These settings are handled differently for different SDK versions and different MCUs so consult the readme.txt file available in the docs/ folder of each example for information.

  3. Select the desired build target from the drop-down. For this example, select the debug target.

    IAR - Build target

    The target name indicates from where the application is executing, see table below. The name also indicates if it is a release or debug target. Release targets have a higher compiler optimization degree making the target less suitable for debugging. Available targets differ from example to example but here are some of the more common ones.

    sdram_debug
    sdram_release
    The application runs in internal SRAM but with data in external SDRAM
    sdram_txt_debug
    sdram_txt_release
    The application runs in external SDRAM but with data in internal SRAM
    debug
    release
    The application runs in internal SRAM
    flexspi_nor_debug
    flexspi_nor_release
    The application runs in external flash, which must be programmed before use
    flexspi_nor_sdram_debug
    flexspi_nor_sdram_release
    The application runs in external flash and use SDRAM. The external flash must be programmed before use.
    note

    Note that the target has its own set of options so changing for example include path in one target does not affect the other targets.

  4. To build the demo application, click the Make button, highlighted in red below.

    IAR - Make button

  5. The build will complete without errors.

Run an Example Application

To download and run the application, perform these steps:

  1. Prepare the hardware as described in the Preparing the hardware section and power it on.

  2. Open the terminal application on the PC, such as TeraTerm or PuTTY, and connect to the virtual COM port. Configure the terminal with 115200 baud, 8N1. You can alter the baud rate by searching for the BOARD_DEBUG_UART_BAUDRATE define in file: board.h

  3. Click the Download and Debug button to download the application to the target.

    IAR - Download and debug button

  4. The application is then downloaded to the target and automatically runs to the main() function.

  5. Run the code by clicking the Go button to start the application

    IAR - Run button

  6. The hello_world application is now running, and a banner is displayed on the terminal. If this is not true, check your terminal settings and connections.

    IAR - Hello World output in terminal