Zephyr Lab RT1060 Hello World - nxp-mcuxpresso/vscode-for-mcux GitHub Wiki

Objectives

In this lab, you will learn:

  • How to import an example from the Zephyr Repo in the VS Code workspace
  • How to build, clean, debug, and run the example
  • How to connect the Serial Monitor for UART console
  • How to navigate and edit files in the Explorer view

Hello_World Lab

After successfully installing Zephyr and setting up the VS Code extension for MCUXpresso, let’s go through the detailed steps to run the Zephyr hello_world application on the RT1060 EVKB.

1. Import hello_world sample

  1. To import the hello_world application from the Zephyr Repository, click Import example from Repository in the PROJECTS view.

    Import example from repo


  1. Select the following board settings to import the example:
  • For selecting the board, type RT1060 to find the board arm/mimxrt1060_evkb. Make sure that the board ends with ‘B’ for the EVKB.

  • For selecting the example, type hello to find the application samples/hello_world

  • For application type, select Repository Application.

  • Click Create and the example should be added to the PROJECTS view.

    Import example project

2. Build the application

The hello_world project needs to build the application image. After the code builds without any errors, the application can be run on the EVK board.

  1. Build the project by clicking the Build Selected Gear icon.

    Build project

    After the build, the debug console window displays the memory usage (or compiler errors if any).

    Build output

3. Connect Serial Monitor to the board

To use the Serial Monitor integrated into VS Code, connect the micro-USB cable to J1 to power the EVK. The onboard debugger provides a USB-UART bridge to interface with the Serial monitor.

  1. Connect the Serial monitor to the EVK’s COM port and select the Baud rate. The screenshots show the EVK enumerates as COM15, but the COM port number may be different for you. To capture the data sent over UART, click Start Monitoring.

    It can be disconnected by clicking Stop Monitoring after debug.

    Serial Monitor


  1. If the serial monitor view is disabled, right-click on the panel and select the Serial Monitor option.

    Serial Monitor option


  1. Optional settings for the Serial Monitor:
    6.1. To add a monitor for another COM port select Open an additional monitor.
    6.2. Click the icon to clear the output terminal.
    6.3. Click the gear icon for additional settings (data bits, stop bits, parity, DTR, RTS).
    6.4. To send a message to the serial terminal, type the command in the text box.

    Settings for Serial Monitor

4. Debug the application

This section uses the GDB debugger to connect to the MCU, and program the flash.

  1. Click the play icon to Debug the application:

    Debug project


  1. When first connecting to a device and using the LinkServer debug probe, VS Code will use a pop-up to ask for the device part number. In the search field, enter MIMXRT1062xxxxx:MIMXRT1060-EVKB. You can search with part of the device or board part number.

    Select device

Note: In future revisions of the tool, this step will go away, and the extension will select the device automatically.

  1. The execution will pause. To continue execution click Continue on the debug options.

    Continue debugging


  1. In the Serial Monitor view, the application prints the boot banner during the startup code and halts at main(). The boot banner also includes the version of Zephyr used in the build. Click the Continue button again to continue execution, and the application prints hello world.

    Hello_World printed to Console


5. Clean up after lab

This lab is completed. But the following steps will clean up the VS Code workspace:

  1. Click Stop to end the debug session.

    Stop Debugger

  2. Close all Editor tabs. Right-Click on a tab, and select Close All.

  3. If this is the last lab and you are done using the board, you should disconnect the Serial Monitor. Find the Serial Monitor view, and click Stop Monitoring.

    Stop Serial Monitor


Lab completed. Return to the RT1060 Zephyr Labs Overview Training Zephyr Getting Started RT1060

⚠️ **GitHub.com Fallback** ⚠️