Skip to content

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:

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.

  1. Open a terminal window.

  2. Go to NCS-Project/nrf54l15-connectkit repository cloned in the Getting Started Guide.

  3. Build the application using the west build command, specifying the board (following the -b option) as nrf54l15_connectkit/nrf52820.

    west build -p always -b nrf54l15_connectkit/nrf52820 applications/ifmcu_firmware
    

    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.

  4. After building the application successfully, the firmware with the name zephyr.uf2 can be found in the build/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:

  1. 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.

  2. It will mount as a Mass Storage Device called UF2BOOT. The RGB LED is breathing in green.

  3. Drag and drop zephyr.uf2 onto the UF2BOOT volume. The RGB LED blinks green rapidly during programming.

  4. 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:

Terminal
1
2
3
$ cp build/ifmcu_firmware/zephyr/zephyr.uf2 /Volumes/UF2BOOT
cp: /Volumes/UF2BOOT/zephyr.uf2: fcopyfile failed: Input/output error
cp: /Volumes/UF2BOOT/zephyr.uf2: fchmod failed: No such file or directory

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:

    Terminal
    1
    2
    3
    4
    #   Probe/Board              Unique ID               Target
    -----------------------------------------------------------------
    0   ZEPHYR IFMCU CMSIS-DAP   820D9A5F0E322B8EFE662   ✔︎ nrf54l
        Makerdiary               nRF54L15 Connect Kit
    
  • To program the nRF54L15 application firmware, use pyocd load:

    pyocd load -t nrf54l <firmware.hex> # (1)!
    
    1. You can also use pyocd flash instead:
      pyocd flash -t nrf54l <firmware.hex>
      
  • To erase the entire non-volatile memory (RRAM) of the nRF54L15, run the following command:

    pyocd erase -t nrf54l --chip
    

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:

  1. Start PuTTY.
  2. Configure the correct serial port and click Open:

Open up a terminal and run:

screen <serial-port-name> 115200

Open up a terminal and run:

screen <serial-port-name> 115200

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:

  1. Start PuTTY.
  2. Configure the correct serial port and click Open:

Open up a terminal and run:

screen <serial-port-name> 115200

Open up a terminal and run:

screen <serial-port-name> 115200

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.

Terminal
ifsh:~$
  bootloader  cfgsync     clear       device      gpio        help
  history     i2c         kernel      rem         reset       resize
  retval      settings    shell       temp        version     viosel
ifsh:~$ i2c --help
i2c - I2C commands
Subcommands:
  scan  : Scan I2C devices
                 Usage: scan <device>
  recover  : Recover I2C bus
                 Usage: recover <device>
  read  : Read bytes from an I2C device
                 Usage: read <device> <addr> <reg> [<bytes>]
  read_byte  : Read a byte from an I2C device
                 Usage: read_byte <device> <addr> <reg>
  direct_read  : Read byte stream directly from an I2C device without writing a
                 register address first
                 Usage: direct_read <device> <addr> [<bytes>]
  write  : Write bytes to an I2C device
                 Usage: write <device> <addr> <reg> [<byte1>, ...]
  write_byte  : Write a byte to an I2C device
                 Usage: write_byte <device> <addr> <reg> <value>
  speed  : Configure I2C bus speed
                 Usage: speed <device> <speed>
ifsh:~$

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 millisecond.
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