Interface MCU Firmware¶
Overview¶
This guide walks you through building and running the Interface MCU Firmware which enables a CMSIS-DAP interface for debug and programming, a USB-UART bridge for terminal emulation and an Interface Shell for accessing board-specific functionality.
How it works¶
The nRF54L15 Connect Kit comes with an nRF52820-based Interface MCU. The Interface MCU Firmware is running on the nRF52820. It implements a CMSIS-DAP interface for debugging and programming the nRF54L15. It also exposes two USB CDC ACM devices, one acts as a UART bridge between the host and the nRF54L15, the other enables an Interface Shell for accessing board-specific functionality.
The Interface MCU also comes pre-programmed with the UF2 Bootloader, an easy-to-use and self-upgradable bootloader that can be used to update the firmware by just copying the .uf2-format images to the flash drive without using an external programmer.
The following figure describes the functional architecture of the Interface MCU:
Requirements¶
Before you start, check that you have the required hardware and software:
- 1x nRF54L15 Connect Kit
- 1x USB-C Cable
- A computer running macOS, Ubuntu, or Windows 10 or newer
Building the application¶
To build the application, follow the instructions in Getting Started Guide to set up your preferred building environment.
Use the following steps to build the Interface MCU Firmware on the command line.
-
Open a terminal window.
-
Go to
NCS-Project/nrf54l15-connectkit
repository cloned in the Getting Started Guide. -
Build the application using the
west build
command, specifying the board (following the-b
option) asnrf54l15_connectkit/nrf52820
.Tip
The
-p
always option forces a pristine build, and is recommended for new users. Users may also use the-p auto
option, which will use heuristics to determine if a pristine build is required, such as when building another application. -
After building the application successfully, the firmware with the name
zephyr.uf2
can be found in thebuild/ifmcu_firmware/zephyr
directory.
Flashing the firmware¶
The application is compatible with the UF2 Bootloader, so that you can easily flash the firmware by just copying the zephyr.uf2
file to the flash drive without using an external programmer.
To flash the firmware, complete the following steps:
-
Push and hold the DFU/RST button and connect your board to the USB port of your computer. Release the DFU/RST button after your board is connected.
-
It will mount as a Mass Storage Device called UF2BOOT. The RGB LED is breathing in green.
-
Drag and drop
zephyr.uf2
onto the UF2BOOT volume. The RGB LED blinks green rapidly during programming. -
The application starts running after the firmware programming is completed.
Note
You may experience the following errors when copying the firmware to the UF2BOOT drive on macOS 14.5 or newer:
Currently you can ignore these errors as the firmware programming is completed and the application should work as expected.
Usage¶
Using the CMSIS-DAP Interface¶
You can use the CMSIS-DAP Interface to debug or program the nRF54L15.
Before you start, a tool that supports the CMSIS-DAP protocol should be installed. pyOCD v0.38.0 or newer is required. pyOCD will be installed after setting up your development environment in Getting Started Guide.
Note
On Linux, permission to access USB devices from user space must be explicitly granted via udev rules. See udev rules on Linux for detailed instructions.
The following sections show the typical use cases with pyOCD:
-
To show the connected devices, use
pyocd list
: -
To program the nRF54L15 application firmware, use
pyocd load
:- You can also use
pyocd flash
instead:
- You can also use
-
To erase the entire non-volatile memory (RRAM) of the nRF54L15, run the following command:
To learn more about pyOCD, see the pyOCD Documentation.
Using the USB-UART Bridge¶
The primary USB CDC ACM device that the Interface MCU exposes acts as a UART bridge between the host and the nRF54L15.
To see the UART output, connect to the board with a terminal emulator, specifying the correct serial port that your computer uses to communicate with the nRF54L15:
- Start PuTTY.
-
Configure the correct serial port and click Open:
Tip
The default serial port settings are the following:
Baud rate | Data bits | Stop bits | Parity | Flow Control |
---|---|---|---|---|
115200 | 8 | 1 | None | None |
Using the Interface Shell¶
The secondary USB CDC ACM device that the Interface MCU exposes enables an Interface Shell for accessing the board-specific functionality.
To interact with the Interface Shell, connect to the board with a terminal emulator, specifying the correct serial port that your computer uses to communicate with the shell:
- Start PuTTY.
-
Configure the correct serial port and click Open:
Tip
The default serial port settings are the following:
Baud rate | Data bits | Stop bits | Parity | Flow Control |
---|---|---|---|---|
115200 | 8 | 1 | None | None |
Type Tab to list all supported commands. When you type a command with --help
, the terminal shows its usage, for example i2c --help
. For more information about the commands, see the Interface Shell Command Reference.
Interface Shell Command Reference¶
The following table describes all supported commands of the Interface Shell:
Command | Description |
---|---|
bootloader | Enter Interface MCU UF2 Bootloader. |
cfgsync | Store settings to the non-volatile memory. Only viosel commands can affect the settings. |
clear | Clear shell screen. |
device list | List all configured devices in the devicetree. |
gpio conf <device> <pin> <configuration <i|o>[u|d][h|l][0|1]> [vendor specific] | Configure GPIO pin. |
gpio get <device> <pin> | Get GPIO pin value. |
gpio set <device> <pin> <level 0|1> | Set GPIO pin value. |
gpio toggle <device> <pin> | Toggle GPIO pin. |
gpio devices | List all GPIO devices. |
gpio blink <device> <pin> | Blink GPIO pin. |
gpio info [device] | GPIO Information. |
help | Show help information. |
history | Show command history. |
i2c scan <device> | Scan I2C devices. Use device list to get the I2C bus name <device> . |
i2c recover <device> | Recovery I2C bus. Use device list to get the I2C bus name <device> . |
i2c read <device> <addr> <reg> [<bytes>] | Read bytes from an I2C device. Use device list to get the I2C bus name <device> . |
i2c read_byte <device> <addr> <reg> | Read a byte from an I2C device. Use device list to get the I2C bus name <device> . |
i2c direct_read <device> <addr> [<bytes>] | Read byte stream directly from an I2C device without writing a register address first. Use device list to get the I2C bus name <device> . |
i2c write <device> <addr> <reg> [<byte1>, ...] | Write bytes to an I2C device. Use device list to get the I2C bus name <device> . |
i2c write_byte <device> <addr> <reg> <value> | Write a byte to an I2C device. Use device list to get the I2C bus name <device> . |
i2c speed <device> <speed> | Configure I2C bus speed. Use device list to get the I2C bus name <device> . |
kernel cycles | Get Kernel cycles. |
kernel reboot | Reboot kernel. |
kernel sleep <ms> | Kernel sleeps for |
kernel thread list | List kernel threads. |
kernel thread stacks | List threads stack usage. |
rem | Ignore lines beginning with 'rem '. |
reset [nrf54l15] | Reset nRF54L15. |
reset nrf52820 | Reset nRF52820. |
resize | Console gets terminal screen size or assumes default in case the readout fails. It must be executed after each terminal width change to ensure correct text display. |
resize default | Assume 80 chars screen width and send this setting to the terminal. |
retval | Print return value of most recent command. |
settings list [subtree] | List all settings in a subtree (omit to list all). |
settings read [type] <name> | Read a specific setting. type : string or hex (default: hex ) |
settings write [type] <name> <value> | Write to a specific setting. type : string or hex (default: hex ) |
settings delete <name> | Delete a specific setting. |
shell backends | List active shell backends. |
shell backspace_mode | Toggle backspace key mode. Some terminals are not sending separate escape code for backspace and delete key. This command forces shell to interpret delete key as backspace. |
shell colors | Toggle colored syntax. |
shell vt100 | Toggle vt100 commands. |
shell prompt | Toggle prompt. |
shell echo | Toggle shell echo. |
shell stats reset | Reset shell statistics for the Logger module. |
shell stats show | Get shell statistics for the Logger module. |
temp | Get the die temperature of the nRF52820. |
version [-a|--all] | Show Interface MCU version. Use -a or --all option to show more details. |
viosel [0|1] | Get or set VIO voltage 0 (default): 3.3V 1 : 1.8V |