Zephyr Lab RT1060 Hello World - nxp-mcuxpresso/vscode-for-mcux GitHub Wiki
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
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.
-
To import the hello_world application from the Zephyr Repository, click Import example from Repository in the PROJECTS view.
- 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.
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.
-
Build the project by clicking the Build Selected Gear icon.
After the build, the debug console window displays the memory usage (or compiler errors if any).
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.
-
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.
-
If the serial monitor view is disabled, right-click on the panel and select the Serial Monitor option.
-
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.
This section uses the GDB debugger to connect to the MCU, and program the flash.
-
Click the play icon to Debug the application:
-
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.
Note: In future revisions of the tool, this step will go away, and the extension will select the device automatically.
-
The execution will pause. To continue execution click Continue on the debug options.
-
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
.
This lab is completed. But the following steps will clean up the VS Code workspace:
-
Click Stop to end the debug session.
-
Close all Editor tabs. Right-Click on a tab, and select Close All.
-
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.
Lab completed. Return to the RT1060 Zephyr Labs Overview Training Zephyr Getting Started RT1060