Run a demo using IAR

This section describes the steps required to build, run, and debug example applications provided in the MCUXpresso SDK. This document uses hello_world demo application targeted for the MIMXRT1180-EVK as an example. These steps can be applied to any example application in the MCUXpresso SDK.

Both CMSIS-DAP and J-Link debugging interfaces are supported for IAR IDE. It is recommended to set SW5[1..4] to 0001 for both debugging interfaces. It is required to reset board for each download/debug.

Build an example application

To build the hello_world demo application, perform the following steps:

  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>/<core_type>/iar

    Using the MIMXRT1180-EVK hardware platform as an example, the hello_world workspace is located in:

    <install_dir>/boards/evkmimxrt1180/demo_apps/hello_world/cm33/iar/hello_world_demo_cm33.eww

    Other example applications may have additional folders in their path.

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

    The below lists project configurations (build targets) supported across MCUXpresso SDK projects:

    • Debug – Compiler optimization is set to low, and debug information is generated for the executable. The linker file is RAMlinker, where text and data section is put in internal TCM.

    • Release – Compiler optimization is set to high, and debug information is not generated. The linker file is RAM linker, where text and data section is put in internal TCM.

    • flexspi_nor_debug – Project configuration is same as the debug target. The linker file is flexspi_nor linker, where text is put in flash and data put in TCM.

    • flexspi_nor_release – Project configuration is same as the release target. The linker file is flexspi_nor linker, where text is put in flash and data put in TCM.

    • hyperram_debug – Project configuration is same as the debug target. The linker file is HYPERRAM linker, where text is put in internal TCM and data put in HYPERRAM.

    • hyperram_release – Project configuration is same as the release target. The linker file is HYPERRAM linker, where text is put in internal TCM and data put in HYPERRAM.

    • hyperram_txt_debug – Project configuration is same as the debug target. The linker file is HYPERRAM_txt linker, where text and data section is put in HYPERRAM.

    • hyperram_txt_release – Project configuration is same as the release target. The linker file is HYPERRAM_txt linker, where text and data section is put in HYPERRAM.

    • flexspi_nor_hyperram_release - Project configuration is same as the release target. The linker file is flexspi_nor_hyperram linker, where text is put in flash and data put in HYPERRAM.

    • flexspi_nor_hyperram_debug – Project configuration is same as the debug target. The linker file is flexspi_nor_hyperram linker, where text is put in flash and data put in HYPERRAM. For this example, select hello_world_demodebug.

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

  4. The build completes without errors.

Parent topic:Run a demo using IAR

Run an example application

The default IAR project setting assumes that CMSIS-DAP debug interface is used. When such a debug interface is used, perform the following steps to do the debugging:

  1. Connect the development platform to your PC via USB cable. Connect the USB cable to J53 for serial output.

  2. Open the terminal application on the PC, such as PuTTY or TeraTerm, and connect to the debug COM port (to determine the COM port number, see How to determine COM port). Configure the terminal with these settings:

    1. 115200 baud or 9600 baud rate, depending on your board (reference BOARD_DEBUG_UART_BAUDRATE variable in the board.h file)

    2. No parity

    3. 8 data bits

    4. 1 stop bit

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

  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.

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

Parent topic:Run a demo using IAR

Build and run a multicore example application

This section describes the steps to build and run a dual-core application. The demo applications workspace files are available in the folder: <install_dir>/boards/<board_name>/multicore_examples/<application_name>/<core_type>/iar

Begin with a simple dual-core version of the Hello World application. The multicore Hello World IAR workspaces are available in the folder:

<install_dir>/boards/evkmimxrt1180/multicore_examples/hello_world/cm7/iar/hello_world_cm7.eww

<install_dir>/boards/evkmimxrt1180/multicore_examples/hello_world/cm33/iar/hello_world_cm33.eww

Build both applications separately by clicking the Make button. Build the application for the auxiliary core (cm7) first, because the primary core application project (cm33) must know the auxiliary core application binary when running the linker. When the auxiliary core application binary is not ready, it is impossible to finish the primary core linker.

By default, the primary core flexspi_nor_debug target links the auxiliary core debug target, and the primary core flexspi_nor_release target links the auxiliary core release target. During the primary core execution, the auxiliary core image is copied from flash into the CM7 RAM and executed.

  1. Build the CM7 and CM33 projects respectively.

  2. Only click the Download and Debug button on the CM33 project, IAR could help start to debug a multicore project. It is user-friendly to debug multicore examples with CMSIS-DAP on IAR (Multicore Project is set on Debugger->Multicore window).

  3. Start core0 and then start core1 on the CM33 project.

  4. Hello_World multicore demos are now running. A banner appears on the terminal and the LED D6 blinks. If this is not true, check your terminal settings and connections.

Parent topic:Run a demo using IAR