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.
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.
Select the desired build target from the drop-down menu.
For this example, select hello_world – debug.
|
|
To build the demo application, click Make, highlighted in red in Figure 2.
|
|
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:
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.
Connect the development platform to your PC via USB cable between the DBG USB connector (J26) and the PC USB connector.
Connect 12 V ~ 20 V power supply and J-Link Plus to the device.
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.
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:
115,200 baud rate
No parity
8 data bits
1 stop bit
|
|
Power on the board.
In IAR, click Download and Debug to download the application to the target.
|
|
The application then downloads to the target and automatically runs to the
main()
function.|
|
Run the code by clicking Go to start the application.
|
|
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