Table of Contents | ||
---|---|---|
|
1. Overview
This note describes how to set up and use the serial consoles for the nRF9161 and nRF5340 MCUs. Use of the Zephyr interactive shell command interface, on top of the serial consoles, is explained as well.
2. Setting Up Serial Consoles
2.1. VCOM and USB Serial Ports
The Nordic kits are typically configured to expose 2 VCOM serial ports as CDC-UART USB devices on the main (interface MCU) USB connector.
The main nRF5340 SoC on the nRF5340 DK has its own USB interface and the corresponding USB connector (J3) that can also expose (USB) serial ports as CDC-UART USB devices. The Emcraft Zephyr application enables the appropriate USB device to support this feature.
2.2. Identifying Development Kits and VCOM Serial Ports
Use
nrfutil
to list all connected development kits, their serial numbers and associated serial ports:Code Block $ nrfutil device list 1050021575 product J-Link board version PCA10095 ports /dev/ttyACM2, vcom: 0 /dev/ttyACM3, vcom: 1 traits devkit, jlink, seggerUsb, serialPorts, usb 1050931892 product J-Link board version PCA10153 ports /dev/ttyACM0, vcom: 0 /dev/ttyACM1, vcom: 1 traits boardController, devkit, jlink, modem, seggerUsb, serialPorts, usb Found 2 supported device(s)
Use
nrfutil
to identify the specific devices:Code Block $ nrfutil device device-info --serial-number 1050931892 serial_number: 001050931892 boardVersion: PCA10153 deviceFamily: NRF91_FAMILY deviceVersion: NRF9161_xxAA_REV3 jlinkObFirmwareVersion: J-Link OB-nRF5340-NordicSemi compiled Apr 11 2024 17:44:26 protectionStatus: NRFDL_PROTECTION_STATUS_NONE $ nrfutil device device-info --serial-number 1050021575 serial_number: 001050021575 boardVersion: PCA10095 deviceFamily: NRF53_FAMILY deviceVersion: NRF5340_xxAA_ENGD jlinkObFirmwareVersion: J-Link OB-nRF5340-NordicSemi compiled Apr 11 2024 17:44:26 protectionStatus: NRFDL_PROTECTION_STATUS_NONE
dmesg
can also be used to identify the VCOM serial ports:Code Block $ sudo dmesg ... [1198894.160703] usb 1-2.2: new full-speed USB device number 9 using uhci_hcd [1198894.576542] usb 1-2.2: New USB device found, idVendor=1366, idProduct=1059, bcdDevice= 1.00 [1198894.576550] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1198894.576553] usb 1-2.2: Product: J-Link [1198894.576564] usb 1-2.2: Manufacturer: SEGGER [1198894.576567] usb 1-2.2: SerialNumber: 001050931892 [1198894.589375] cdc_acm 1-2.2:1.0: ttyACM0: USB ACM device [1198894.596846] cdc_acm 1-2.2:1.2: ttyACM1: USB ACM device ... [1199003.499651] usb 1-2.3: new full-speed USB device number 10 using uhci_hcd [1199003.721099] usb 1-2.3: New USB device found, idVendor=1366, idProduct=1051, bcdDevice= 1.00 [1199003.721125] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1199003.721137] usb 1-2.3: Product: J-Link [1199003.721146] usb 1-2.3: Manufacturer: SEGGER [1199003.721154] usb 1-2.3: SerialNumber: 001050021575 [1199003.744604] cdc_acm 1-2.3:1.0: ttyACM2: USB ACM device [1199003.752999] cdc_acm 1-2.3:1.2: ttyACM3: USB ACM device ...
2.3. Identifying USB Serial Ports of nRF5340
Use dmesg
to identify the USB Serial Ports exposed on the J3 USB connector by the main nRF5340 SoC of the nRF5340 DK:
...
Note that the CDC-ACM USB device is disconnected and connected again on every reset of the nRF5340 SoC.
2.4. Serial Console of the nRF9161
The nRF9161 serial console is available on the VCOM0 serial port of the nRF9161 DK. Connect to it using a terminal program on your Linux PC:
...
Code Block |
---|
*** Booting nRF Connect SDK v2.5.1-5-gb2bb1a280782 *** [00:00:00.254,577] <inf> app: Start thingy9151lite_nrf9151_app v98.98-14-release on nrf9161dk_nrf9161 uart:~$ |
2.5. Serial Console of the nRF5340 Application Core
The nRF5340 (application core) serial console is available on the USB serial port of the nRF5340. Connect to it using a terminal program on your Linux PC:
...
Code Block |
---|
*** Booting nRF Connect SDK v2.5.1-5-gb2bb1a280782 *** [00:00:00.251,098] <inf> app: Start thingy9151lite_nrf5340_cpuapp_app v98.98-14-release on nrf5340dk_nrf5340_cpuapp uart:~$ |
2.6. Serial Console of the nRF5340 Network Core
The nRF5340 (network core) serial console is available on the VCOM0 serial port of the nRF5340 DK. Connect to it using a terminal program on your Linux PC:
...
The nRF5340 Network Core application only provides logging output to the console, as the Zephyr shell is disabled in the project configuration.
...
3. Using Zephyr Shell
The Thingy-9151-Lite software is configured to run the Zephyr interactive shell command interfaces, in the serial consoles for all the MCU’s.
Most of the standard Zephyr shell features are available, such as the auto-completion, command history, etc.
Also, some generic Various Zephyr shell commands are supportedenabled:
Code Block |
---|
uart:~$ kernel kernel - Kernel commands Subcommands: cycles :Kernel cycles. reboot :Reboot. stacks :List threads stack usage. threads :List kernel threads. version :Kernel version. sleep :ms log-level :<module name> <severity (0-4)> uart:~$ device device - Device commands Subcommands: list :List configured devices uart:~$ |