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:
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.
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 isRAM
linker, 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 isRAM
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 isflexspi_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 isflexspi_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 isHYPERRAM_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 isHYPERRAM_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 isflexspi_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 isflexspi_nor_hyperram
linker, where text is put in flash and data put in HYPERRAM. For this example, select hello_world_demo– debug.
To build the demo application, click Make, highlighted in red in Figure 2.
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:
Connect the development platform to your PC via USB cable. Connect the USB cable to J53 for serial output.
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:
115200 baud or 9600 baud rate, depending on your board (reference
BOARD_DEBUG_UART_BAUDRATE
variable in the board.h file)No parity
8 data bits
1 stop bit
In IAR, click the Download and Debug button to download the application to the target.
The application is then downloaded to the target and automatically runs to the
main()
function.Run the code by clicking the Go button to start the application.
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.
Build the CM7 and CM33 projects respectively.
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).Start
core0
and then startcore1
on the CM33 project.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
Run applications via JLink debug interface
When JLink Debug Interface is used, manually revise Debug Configuration under Project > Options > Debugging.
Change the debug driver to
J-Link/J-Trace
.Uncheck Use macro file(s).
In the Extra Options, specify a
jlinkscript
. Thejlinkscript
files can be found in SDK package boards/evkmimxrt1180/jlinkscript.evkmimxrt1180_cm33.jlinkscript
is for CM33 projects andevkmimxrt1180_cm7.jlinkscript
is for CM7 projects. Use--jlink_script_file=<full patch>
to specify it.
After these settings, debugging can be performed via the J-Link debugging interface.
Note: If IAR version is higher than or equal to 9.60.1, perform just Step 1.
Parent topic:Run a demo using IAR