This is the documentation for the latest (main) development branch of mcuxpresso sdk. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

Run a demo application using IAR

This section describes the steps required to build, run, and debug example applications provided in the MCUXpresso SDK. The hello_world demo application targeted for the i.MX 93 AUTO EVK hardware platform is used as an example, although these steps can be applied to any example application in the MCUXpresso SDK.

Build an example application

Perform the following steps to build the hello_world example application.

  1. Open the desired demo application workspace. Most example application workspace files can be located using the following path:

    <install_dir>/boards/<board_name>/<example_type>/<application_name>/iar
    

    Using the i.MX 93 AUTO EVK hardware platform as an example, the hello_world workspace is located in:

    <install_dir>/boards/mcimx93autoevk/demo_apps/hello_world/iar/hello_world.eww
    

    Other example applications may have additional folders in their path.

  2. Select the desired build target from the drop-down menu.

    For this example, select hello_worlddebug.

    |

|

  1. To build the demo application, click Make, highlighted in red in Figure 2.

    |

|

  1. The build completes without errors.

Parent topic:Run a demo application using IAR

Run an example application

To download and run the application, perform these steps:

  1. This board supports the J-Link PLUS debug probe. Before using it, install SEGGER J-Link software, as per the requirement listed in Toolchain introduction.

  2. Connect the development platform to your PC via USB cable between the DBG USB connector (J26) and the PC USB connector.

  3. Connect 12 V ~ 20 V power supply and J-Link Plus to the device.

  4. Switch SW5[1:4] to the M core boot and ensure that the image is not available on the boot source. For example, 0b0101 for MicroSD boot. Keep the SD slot empty.

  5. Open the terminal application on the PC, such as PuTTY or TeraTerm, connect to the debug COM port, see How to determine COM port, and configure the terminal with these settings:

    1. 115,200 baud rate

    2. No parity

    3. 8 data bits

    4. 1 stop bit

      |

|

  1. Power on the board.

  2. In IAR, click Download and Debug to download the application to the target.

    |

|

  1. The application then downloads to the target and automatically runs to the main() function.

    |

|

  1. Run the code by clicking Go to start the application.

    |

|

  1. The hello_world application is now running and a banner is displayed on the terminal. If the application does not run or the banner is not displayed, check your terminal settings and connections.

    |

|

**Note:** If the software is already running on the M core, the debugger loading image into TCM may get HardFault or a data verification issue. NXP recommends you to follow the steps above to use the debugger. Repowering the board is required to restart the debugger.

Parent topic:Run a demo application using IAR