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 LPCXpresso54018 hardware platform is used as an example, although these steps can be applied to any example application in the MCUXpresso SDK.

Before downloading and running the application, perform these steps:

  1. Download and install LPCScrypt or the Windows® operating systems driver for LPCXpresso boards from www.nxp.com/lpcutilities. This installs the required drivers for the board.

  2. Connect the development platform to your PC via USB cable between the Link2 USB connector (named Link for some boards) and the PC USB connector. If you are connecting for the first time, allow about 30 seconds for the devices to enumerate.

  3. 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 Appendix A). Configure the terminal with these settings:

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

    2. No parity

    3. 8 data bits

    4. 1 stop bit

Build an non-XIP (plain load) example application

Do 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 LPCXpresso54018 hardware platform as an example, the hello_world workspace is located in:

    <install_dir>/boards/lpcxpresso54018/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.

  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 application using IAR

Run a non-XIP (plain load) example application using CMSIS DAP

  1. In IAR, click the “Download and Debug” button to download the application to the target.

  2. The application is then downloaded to the target and automatically runs to the main() function.

    Note: The application is programmed to the external on board flash, then jumped to SRAM to run

  3. Run the code by clicking the “Go” button to start the application.

  4. The hello_world application is now running and a banner is displayed on the terminal. If this does not occur, check your terminal settings and connections.

Parent topic:Run a demo application using IAR

Build an XIP example application

The following steps guide you through opening the hello_world_qspi_xip example application. These steps may change slightly for other example applications, as some of these applications may have additional layers of folders in their paths.

  1. If not already done, 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 LPCXpresso54018 hardware platform as an example, the hello_world workspace is located in

    <install_dir>/boards/lpcxpresso54018/demo_apps/hello_world/iar/hello_world_qspi_xip.eww

  2. Select the desired build target from the drop-down. For this example, select the “hello_world_qspi_xip – Debug” target.

  3. Select “Reset and halt after bootloader”, highlighted in red below.

  4. To build the demo application, click the “Make” button, highlighted in red below.

Parent topic:Run a demo application using IAR

Run an XIP example application

  1. In IAR, click the “Download and Debug” button to download the application to the target.

  2. The application is then downloaded to the target and automatically runs to the main() function.

  3. Run the code by clicking the “Go” button to start the application.

  4. The hello_world_qspi_xip 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