This is the documentation for the latest (main) development branch of mcuxpresso sdk. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

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 LPCXpresso51U68 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

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

    <install_dir>/boards/lpcxpresso51U68/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 an example application

To download and run 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 baud rate (reference BOARD_DEBUG_UART_BAUDRATE variable in board.h file)

    2. No parity

    3. 8 data bits

    4. 1 stop bit

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

  5. 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

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

  7. 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