Run a demo application using IAR
This section describes the steps required to build, run, and debug example applications provided in the MCUXpresso SDK.
Note: IAR Embedded Workbench for Arm version 8.32.3 is used in the following example, and the IAR toolchain should correspond to the latest supported version, as described in the MCUXpresso SDK Release Notes.
Build an example application
Do 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 LPCXpresso55S36 Freedom hardware platform as an example, the
hello_world
workspace is located in:<install_dir>/boards/LPCXpresso55S36/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:
See the table in Default debug interfaces to determine the debug interface that comes loaded on your specific hardware platform.
For boards with CMSIS-DAP/mbed/DAPLink interfaces, visit developer.mbed.org/handbook/Windows-serial-configuration and follow the instructions to install the Windows® operating system serial driver. If running on Linux® OS, this step is not required.
For boards with P&E Micro interfaces, visit www.pemicro.com/support/downloads_find.cfm and download the P&E Micro Hardware Interface Drivers package.
Connect the development platform to your PC via USB cable.
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 the LPCXpresso55S36 settings:
115200 or 9600 baud rate, depending on your board (reference
BOARD_DEBUG_UART_BAUDRATE
variable in theboard.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.|
|
| when running
debugging")
|
| when running
debugging")
|
| when running
debugging")
|
| when running
debugging")
|
| when running
debugging")
|
Run the code by clicking the Go button.
|
|
The
hello_world
application is now running and a banner is displayed on the terminal. If it does not appear, check your terminal settings and connections.|
|
Parent topic:Run a demo application using IAR
Build a TrustZone example application
This section describes the particular steps that need to be done in order to build and run a TrustZone application. The demo applications workspace files are located in this folder:
<install_dir>/boards/<board_name>/trustzone_examples/<application_name>/<core_type>/iar/<application_name>_ns/iar
<install_dir>/boards/<board_name>/trustzone_examples/<application_name>/<core_type>/iar/<application_name>_s/iar
Begin with a simple TrustZone version of the Hello World application. The TrustZone Hello World IAR workspaces are located in this folder:
<install_dir>/boards/lpcxpresso55s36/trustzone_examples/hello_world/cm33_core0/hello_world_ns/iar/hello_world_ns.eww
<install_dir>/boards/lpcxpresso55s36/trustzone_examples/hello_world/cm33_core0/hello_world_s/iar/hello_world_s.eww
<install_dir>/boards/lpcxpresso55s36/trustzone_examples/hello_world/cm33_core0/hello_world_s/iar/hello_world.eww
This project hello_world.eww
contains both secure and non-secure projects in one workspace and it allows the user to easily transition from one project to another. Build both applications separately by clicking Make. It is requested to build the application for the secure project first, because the non-secure project needs to know the secure project, since the CMSE library is running the linker. It is not possible to finish the non-secure project linker with the secure project since CMSE library is not ready.
Parent topic:Run a demo application using IAR
Run a TrustZone example application
The secure project is configured to download both secure and non-secure output files, so debugging can be fully managed from the secure project. To download and run the TrustZone application, switch to the secure application project and perform steps 1 – 4 as described in Section 4.2, Run an example application. These steps are common for both single core, dual-core,and TrustZone applications in IAR. After clicking Download and Debug, both the secure and non-secure image are loaded into the device flash memory, and the secure application is executed. It stops at the Rest_Hander
function.
|
|
Run the code by clicking Go to start the application.
|
|
The TrustZone 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.
|
|
Parent topic:Run a demo application using IAR