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_worlddemo application targeted for the MIMXRT1060-EVKC 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_worldexample 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 MIMXRT1060-EVKC hardware platform as an example, the hello_world workspace is located in:

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

    There are twelve project configurations (build targets) supported for most MCUXpresso SDK projects:

    • Debug– Compiler optimization is set to low, and debug information is generated for the executable. The linker file is RAMlinker, 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 is RAMlinker, where text and data section is put in internal TCM.

    • ram_0x1400_debug– Project configuration is same as the debug target. The linker file is RAM_0x1400linker, where text is put in ITCM with offset 0x1400 and data put in DTCM.

    • ram_0x1400_release– Project configuration is same as the release target. The linker file is RAM_0x1400linker, where text is put in ITCM with offset 0x1400 and data put in DTCM.

    • sdram_debug– Project configuration is same as the debug target. The linker file is SDRAMlinker, where text is put in internal TCM and data put in SDRAM.

    • sdram_release– Project configuration is same as the release target. The linker file is SDRAMlinker, where text is put in internal TCM and data put in SDRAM.

    • sdram_txt_debug– Project configuration is same as the debug target. The linker file is SDRAM_txtlinker, where text is put in SDRAM and data put in OCRAM.

    • sdram_txt_release– Project configuration is same as the release target. The linker file is SDRAM_txtlinker, where text is put in SDRAM and data put in OCRAM.

    • flexspi_nor_debug– Project configuration is same as the debug target. The linker file is flexspi_norlinker, 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 is flexspi_norlinker, where text is put in flash and data put in TCM.

    • flexspi_nor_sdram_release- Project configuration is same as the release target. The linker file is flexspi_nor_sdramlinker, where text is put in flash and data put in SDRAM.

    • flexspi_nor_sdram_debug– Project configuration is same as the debug target. The linker file is flexspi_nor_sdramlinker, where text is put in flash and data put in SDRAM. For some examples need large data memory, only sdram_debugand sdram_releasetargets are supported.

    For this example, select hello_worlddebug.

  3. To build the demo application, click Make, highlighted in red in .

  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. This board supports the CMSIS-DAP/mbed/DAPLink debug probe by default. Visit os.mbed.com/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.

  2. Connect the development platform to your PC via USB cable. Connect the USB cable to J1 and make sure SW4[1:4] is 0010b.

  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 How to determine COM port). Configure the terminal with these settings:

    1. 115200 or 9600 baud rate, depending on your board (reference BOARD_DEBUG_UART_BAUDRATE variable in the 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.

  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 is not true, check your terminal settings and connections.

    Note: The jlinkscript file is erquired for debugging sdram target with JLINK as probe. You must uncheck Use flash loader(s) and change the contents of the command-line options as : --jlink_script_file=$PROJ_DIR$/../evkcmimxrt1060_sdram_init.jlinkscript.

Parent topic:Run a demo application using IAR