boards: arduino: Add support for the Arduino Nano Matter

Add device tree and support files for the Nano Matter board
based on the Silicon Labs MGM240SD22VNA chip.

Signed-off-by: Tamas Jozsi <tamas.jozsi@silabs.com>
This commit is contained in:
Tamas Jozsi 2025-06-16 09:28:06 +02:00 committed by Benjamin Cabé
commit 31e48a8b3a
13 changed files with 550 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# Copyright (c) 2020 Piotr Mienkowski
# Copyright (c) 2020 TriaGnoSys GmbH
# Copyright (c) 2025 Pete Johanson
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ARDUINO_NANO_MATTER
select SOC_PART_NUMBER_MGM240SD22VNA

View file

@ -0,0 +1,34 @@
# Copyright (c) 2020 Piotr Mienkowski
# Copyright (c) 2020 TriaGnoSys GmbH
# Copyright (c) 2025 Pete Johanson
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0
if BOARD_ARDUINO_NANO_MATTER
config LOG_BACKEND_SWO_FREQ_HZ
default 875000
depends on LOG_BACKEND_SWO
if SOC_GECKO_USE_RAIL
config FPU
default y
endif # SOC_GECKO_USE_RAIL
if BT
config FPU
default y
config COMMON_LIBC_MALLOC_ARENA_SIZE
default 8192
config MAIN_STACK_SIZE
default 3072 if PM
default 2304
endif # BT
endif # BOARD_ARDUINO_NANO_MATTER

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2025 Pete Johanson
* Copyright (c) 2025 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <dt-bindings/pinctrl/silabs/xg24-pinctrl.h>
&pinctrl {
eusart0_default: eusart0_default {
group0 {
pins = <EUSART0_TX_PA4>;
drive-push-pull;
output-high;
};
group1 {
pins = <EUSART0_RX_PA5>;
input-enable;
silabs,input-filter;
};
};
eusart1_default: eusart1_default {
group0 {
pins = <EUSART1_TX_PA9>, <EUSART1_SCLK_PB4>;
drive-push-pull;
output-high;
};
group1 {
pins = <EUSART1_RX_PA8>;
input-enable;
silabs,input-filter;
};
};
i2c0_default: i2c0_default {
group0 {
pins = <I2C0_SCL_PA7>, <I2C0_SDA_PA6>;
drive-open-drain;
bias-pull-up;
};
};
usart0_default: usart0_default {
group0 {
pins = <USART0_TX_PC4>;
drive-push-pull;
output-high;
};
group1 {
pins = <USART0_RX_PC5>;
input-enable;
silabs,input-filter;
};
};
};

View file

@ -0,0 +1,213 @@
/*
* Copyright (c) 2025 Pete Johanson
* Copyright (c) 2025 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <silabs/xg24/mgm240sd22vna.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "arduino_nano_matter-pinctrl.dtsi"
#include "arduino_nano_matter_connector.dtsi"
/ {
model = "Arduino Nano Matter";
compatible = "arduino,arduino_nano_matter", "silabs,mgm240sd22vna";
chosen {
zephyr,bt-hci = &bt_hci_silabs;
zephyr,code-partition = &slot0_partition;
zephyr,console = &usart0;
zephyr,flash = &flash0;
zephyr,shell-uart = &usart0;
zephyr,sram = &sram0;
zephyr,uart-pipe = &usart0;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
led1 = &led1;
led2 = &led2;
sw0 = &button0;
watchdog0 = &wdog0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
label = "LED 0";
};
led1: led_1 {
gpios = <&gpioc 2 GPIO_ACTIVE_LOW>;
label = "LED 1";
};
led2: led_2 {
gpios = <&gpioc 3 GPIO_ACTIVE_LOW>;
label = "LED 2";
};
};
buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_0>;
};
};
};
&cpu0 {
clock-frequency = <78000000>;
};
&pstate_em3 {
status = "disabled";
};
&hfxo {
ctune = <95>;
precision = <50>;
status = "okay";
};
&lfxo {
ctune = <44>;
precision = <50>;
status = "okay";
};
&hfrcodpll {
clock-frequency = <DT_FREQ_M(78)>;
clocks = <&hfxo>;
dpll-autorecover;
dpll-edge = "fall";
dpll-lock = "phase";
dpll-m = <1919>;
dpll-n = <3839>;
};
&em23grpaclk {
clocks = <&lfxo>;
};
&em4grpaclk {
clocks = <&lfxo>;
};
&sysrtcclk {
clocks = <&lfxo>;
};
&wdog0clk {
clocks = <&lfxo>;
};
&wdog1clk {
clocks = <&lfxo>;
};
&usart0 {
current-speed = <115200>;
pinctrl-0 = <&usart0_default>;
pinctrl-names = "default";
status = "okay";
};
&eusart0 {
compatible = "silabs,eusart-uart";
current-speed = <115200>;
pinctrl-0 = <&eusart0_default>;
pinctrl-names = "default";
};
&eusart1 {
compatible = "silabs,eusart-spi";
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <4000000>;
cs-gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&eusart1_default>;
pinctrl-names = "default";
};
&i2c0 {
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};
&gpio {
location-swo = <0>;
status = "okay";
};
&gpioa {
status = "okay";
};
&gpiob {
status = "okay";
};
&gpioc {
status = "okay";
};
&gpiod {
status = "okay";
};
&wdog0 {
status = "okay";
};
&sysrtc0 {
status = "okay";
};
&se {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Reserve 48 kB for the bootloader */
boot_partition: partition@0 {
reg = <0x0 DT_SIZE_K(48)>;
label = "mcuboot";
read-only;
};
/* Reserve 736 kB for the application in slot 0 */
slot0_partition: partition@c000 {
reg = <0x0000c000 0x000B8000>;
label = "image-0";
};
/* Reserve 736 kB for the application in slot 1 */
slot1_partition: partition@C4000 {
reg = <0x000C4000 0x000B8000>;
label = "image-1";
};
/* Set 16 kB of storage at the end of the 1536 kB of flash */
storage_partition: partition@17c000 {
reg = <0x0017c000 DT_SIZE_K(16)>;
label = "storage";
};
};
};
&bt_hci_silabs {
status = "okay";
};

View file

@ -0,0 +1,20 @@
identifier: arduino_nano_matter
name: Arduino Nano Matter
type: mcu
arch: arm
ram: 256
flash: 1536
toolchain:
- zephyr
- gnuarmemb
supported:
- bluetooth
- gpio
- uart
- dma
- watchdog
- comparator
testing:
ignore_tags:
- pm
vendor: arduino

View file

@ -0,0 +1,43 @@
/*
* Copyright (c) 2025 Peter Johanson
* Copyright (c) 2025 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
arduino_nano_matter_d: connector {
compatible = "arduino,arduino_nano_matter-gpio";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpioa 4 0>, /* D0 */
<1 0 &gpioa 5 0>, /* D1 */
<2 0 &gpioa 3 0>, /* D2 */
<3 0 &gpioc 6 0>, /* D3 */
<4 0 &gpioc 7 0>, /* D4 */
<5 0 &gpioc 8 0>, /* D5 */
<6 0 &gpioc 9 0>, /* D6 */
<7 0 &gpiod 2 0>, /* D7 */
<8 0 &gpiod 3 0>, /* D8 */
<9 0 &gpiod 4 0>, /* D9 */
<10 0 &gpiod 5 0>, /* D10 */
<11 0 &gpioa 9 0>, /* D11 */
<12 0 &gpioa 8 0>, /* D12 */
<13 0 &gpiob 4 0>, /* D13 */
<14 0 &gpiob 0 0>, /* A0 */
<15 0 &gpiob 2 0>, /* A1 */
<16 0 &gpiob 5 0>, /* A2 */
<17 0 &gpioc 0 0>, /* A3 */
<18 0 &gpioa 6 0>, /* A4 */
<19 0 &gpioa 7 0>, /* A5 */
<20 0 &gpiob 1 0>, /* A6 */
<21 0 &gpiob 3 0>; /* A7 */
};
};
arduino_nano_matter_spi: &eusart1 {};
arduino_nano_matter_serial: &eusart0 {};
arduino_nano_matter_i2c: &i2c0 {};

View file

@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_ARM_MPU=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_GPIO=y

View file

@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
board_runner_args(openocd)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
board_runner_args(jlink "--device=MGM240SD22VNA")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -0,0 +1,6 @@
board:
name: arduino_nano_matter
full_name: Arduino Nano Matter
vendor: arduino
socs:
- name: mgm240sd22vna

View file

@ -0,0 +1,121 @@
.. zephyr:board:: arduino_nano_matter
Overview
********
The Nano Matter merges the well-known Arduino way of making complex technology more accessible with the
powerful MGM240S from Silicon Labs, to bring Matter closer to the maker world, in one of the
smallest form factors in the market.
It enables 802.15.4 (Thread®) and Bluetooth® Low Energy connectivity, to interact with Matter-compatible devices
with a user-friendly software layer ready for quick prototyping.
The Nano Matter features a compact and efficient architecture powered by the
MGM240S (32-bit Arm® Cortex®-M33) from Silicon Labs, a high-performance wireless module optimized for
the needs of battery and line-powered IoT devices for 2.4 GHz mesh networks.
Hardware
********
- MGM240SD22VNA2 Mighty Gecko SiP
- CPU core: ARM Cortex®-M33 with FPU
- Flash memory: 1536 kB
- RAM: 256 kB
- Transmit power: up to +20 dBm
- Operation frequency: 2.4 GHz
- Crystals for LFXO (32.768 kHz) and HFXO (39 MHz).
- User RGB LED
- User button
For more information about the EFR32MG24 SoC and the Arduino Nano Matter, refer to these
documents:
- `MGM240S Website`_
- `EFR32MG24 Datasheet`_
- `EFR32xG24 Reference Manual`_
- `Nano Matter User Manual`_
Supported Features
==================
.. zephyr:board-supported-hw::
Connections and IOs
===================
In the following table, the column **Name** contains Pin names. For example, PA2
means Pin number 2 on PORTA, as used in the board's datasheets and manuals.
+-------+-------------+------------------+
| Name | Function | Usage |
+=======+=============+==================+
| PC1 | GPIO | LED0 |
+-------+-------------+------------------+
| PC2 | GPIO | LED1 |
+-------+-------------+------------------+
| PC3 | GPIO | LED2 |
+-------+-------------+------------------+
| PA0 | GPIO | Button |
+-------+-------------+------------------+
| PC4 | USART0_TX | UART Console TX |
+-------+-------------+------------------+
| PC5 | USART0_RX | UART Console RX |
+-------+-------------+------------------+
System Clock
============
The MGM240S SiP is configured to run at 78 MHz using DPLL and the 39 MHz internal oscillator.
Serial Port
===========
The MGM240S SiP has one USART and two EUSARTs.
USART0 is connected to the board controller and is used for the console.
Programming and Debugging
*************************
The Arduino Nano Matter contains an SAMD11 with CMSIS-DAP, allowing flashing, debugging, logging, etc. over
the USB port. Doing so requires a version of OpenOCD that includes support for the flash on the MG24
MCU. Until those changes are included in stock OpenOCD, the version bundled with Arduino can be
used, or can be installed from the `OpenOCD Arduino Fork`_. When flashing, debugging, etc. you may
need to include ``--openocd=/usr/local/bin/openocd
--openocd-search=/usr/local/share/openocd/scripts/`` options to the command.
Flashing
========
Connect the Arduino Nano Matter board to your host computer using the USB port. A USB CDC ACM serial port
should appear on the host, that can be used to view logs from the flashed application.
Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: arduino_nano_matter
:goals: flash
Open a serial terminal (minicom, putty, etc.) connecting to the UCB CDC ACM serial port.
Reset the board and you should see the following message in the terminal:
.. code-block:: console
Hello World! arduino_nano_matter
.. _Nano Matter User Manual:
https://docs.arduino.cc/tutorials/nano-matter/user-manual/
.. _MGM240S Website:
https://www.silabs.com/wireless/zigbee/efr32mg24-series-2-modules/device.mgm240sd22vna
.. _EFR32MG24 Datasheet:
https://www.silabs.com/documents/public/data-sheets/efr32mg24-datasheet.pdf
.. _EFR32xG24 Reference Manual:
https://www.silabs.com/documents/public/reference-manuals/brd4187c-rm.pdf
.. _OpenOCD Arduino Fork:
https://github.com/facchinm/OpenOCD/tree/arduino-0.12.0-rtx5

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -0,0 +1,6 @@
# Copyright (c) 2021 Linaro Limited
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0
# SPI is implemented via usart so node name isn't spi@...
list(APPEND EXTRA_DTC_FLAGS "-Wno-spi_bus_bridge")

View file

@ -0,0 +1,25 @@
if {[info exists env(OPENOCD_INTERFACE)]} {
set INTERFACE $env(OPENOCD_INTERFACE)
} else {
# By default connect over Debug USB port using the CMSIS-DAP interface
set INTERFACE "cmsis-dap"
}
source [find interface/$INTERFACE.cfg]
transport select swd
set CHIPNAME efr32
source [find target/efm32s2_g23.cfg]
$_TARGETNAME configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
$_TARGETNAME configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}