Skip to content

Commit 31e48a8

Browse files
silabs-bozontkartben
authored andcommitted
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>
1 parent e4dc7c9 commit 31e48a8

13 files changed

+550
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2020 Piotr Mienkowski
2+
# Copyright (c) 2020 TriaGnoSys GmbH
3+
# Copyright (c) 2025 Pete Johanson
4+
# Copyright (c) 2025 Silicon Laboratories Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BOARD_ARDUINO_NANO_MATTER
8+
select SOC_PART_NUMBER_MGM240SD22VNA
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2020 Piotr Mienkowski
2+
# Copyright (c) 2020 TriaGnoSys GmbH
3+
# Copyright (c) 2025 Pete Johanson
4+
# Copyright (c) 2025 Silicon Laboratories Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
if BOARD_ARDUINO_NANO_MATTER
8+
9+
config LOG_BACKEND_SWO_FREQ_HZ
10+
default 875000
11+
depends on LOG_BACKEND_SWO
12+
13+
if SOC_GECKO_USE_RAIL
14+
15+
config FPU
16+
default y
17+
18+
endif # SOC_GECKO_USE_RAIL
19+
20+
if BT
21+
22+
config FPU
23+
default y
24+
25+
config COMMON_LIBC_MALLOC_ARENA_SIZE
26+
default 8192
27+
28+
config MAIN_STACK_SIZE
29+
default 3072 if PM
30+
default 2304
31+
32+
endif # BT
33+
34+
endif # BOARD_ARDUINO_NANO_MATTER
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2025 Pete Johanson
3+
* Copyright (c) 2025 Silicon Laboratories Inc.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <dt-bindings/pinctrl/silabs/xg24-pinctrl.h>
9+
10+
&pinctrl {
11+
eusart0_default: eusart0_default {
12+
group0 {
13+
pins = <EUSART0_TX_PA4>;
14+
drive-push-pull;
15+
output-high;
16+
};
17+
18+
group1 {
19+
pins = <EUSART0_RX_PA5>;
20+
input-enable;
21+
silabs,input-filter;
22+
};
23+
};
24+
25+
eusart1_default: eusart1_default {
26+
group0 {
27+
pins = <EUSART1_TX_PA9>, <EUSART1_SCLK_PB4>;
28+
drive-push-pull;
29+
output-high;
30+
};
31+
32+
group1 {
33+
pins = <EUSART1_RX_PA8>;
34+
input-enable;
35+
silabs,input-filter;
36+
};
37+
};
38+
39+
i2c0_default: i2c0_default {
40+
group0 {
41+
pins = <I2C0_SCL_PA7>, <I2C0_SDA_PA6>;
42+
drive-open-drain;
43+
bias-pull-up;
44+
};
45+
};
46+
47+
usart0_default: usart0_default {
48+
group0 {
49+
pins = <USART0_TX_PC4>;
50+
drive-push-pull;
51+
output-high;
52+
};
53+
54+
group1 {
55+
pins = <USART0_RX_PC5>;
56+
input-enable;
57+
silabs,input-filter;
58+
};
59+
};
60+
};
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
/*
2+
* Copyright (c) 2025 Pete Johanson
3+
* Copyright (c) 2025 Silicon Laboratories Inc.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
#include <silabs/xg24/mgm240sd22vna.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
#include "arduino_nano_matter-pinctrl.dtsi"
12+
#include "arduino_nano_matter_connector.dtsi"
13+
14+
/ {
15+
model = "Arduino Nano Matter";
16+
compatible = "arduino,arduino_nano_matter", "silabs,mgm240sd22vna";
17+
18+
chosen {
19+
zephyr,bt-hci = &bt_hci_silabs;
20+
zephyr,code-partition = &slot0_partition;
21+
zephyr,console = &usart0;
22+
zephyr,flash = &flash0;
23+
zephyr,shell-uart = &usart0;
24+
zephyr,sram = &sram0;
25+
zephyr,uart-pipe = &usart0;
26+
};
27+
28+
/* These aliases are provided for compatibility with samples */
29+
aliases {
30+
led0 = &led0;
31+
led1 = &led1;
32+
led2 = &led2;
33+
sw0 = &button0;
34+
watchdog0 = &wdog0;
35+
};
36+
37+
leds {
38+
compatible = "gpio-leds";
39+
40+
led0: led_0 {
41+
gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
42+
label = "LED 0";
43+
};
44+
45+
led1: led_1 {
46+
gpios = <&gpioc 2 GPIO_ACTIVE_LOW>;
47+
label = "LED 1";
48+
};
49+
50+
led2: led_2 {
51+
gpios = <&gpioc 3 GPIO_ACTIVE_LOW>;
52+
label = "LED 2";
53+
};
54+
};
55+
56+
buttons {
57+
compatible = "gpio-keys";
58+
59+
button0: button_0 {
60+
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
61+
zephyr,code = <INPUT_KEY_0>;
62+
};
63+
};
64+
};
65+
66+
&cpu0 {
67+
clock-frequency = <78000000>;
68+
};
69+
70+
&pstate_em3 {
71+
status = "disabled";
72+
};
73+
74+
&hfxo {
75+
ctune = <95>;
76+
precision = <50>;
77+
status = "okay";
78+
};
79+
80+
&lfxo {
81+
ctune = <44>;
82+
precision = <50>;
83+
status = "okay";
84+
};
85+
86+
&hfrcodpll {
87+
clock-frequency = <DT_FREQ_M(78)>;
88+
clocks = <&hfxo>;
89+
dpll-autorecover;
90+
dpll-edge = "fall";
91+
dpll-lock = "phase";
92+
dpll-m = <1919>;
93+
dpll-n = <3839>;
94+
};
95+
96+
&em23grpaclk {
97+
clocks = <&lfxo>;
98+
};
99+
100+
&em4grpaclk {
101+
clocks = <&lfxo>;
102+
};
103+
104+
&sysrtcclk {
105+
clocks = <&lfxo>;
106+
};
107+
108+
&wdog0clk {
109+
clocks = <&lfxo>;
110+
};
111+
112+
&wdog1clk {
113+
clocks = <&lfxo>;
114+
};
115+
116+
&usart0 {
117+
current-speed = <115200>;
118+
pinctrl-0 = <&usart0_default>;
119+
pinctrl-names = "default";
120+
status = "okay";
121+
};
122+
123+
&eusart0 {
124+
compatible = "silabs,eusart-uart";
125+
current-speed = <115200>;
126+
pinctrl-0 = <&eusart0_default>;
127+
pinctrl-names = "default";
128+
};
129+
130+
&eusart1 {
131+
compatible = "silabs,eusart-spi";
132+
#address-cells = <1>;
133+
#size-cells = <0>;
134+
clock-frequency = <4000000>;
135+
cs-gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
136+
pinctrl-0 = <&eusart1_default>;
137+
pinctrl-names = "default";
138+
};
139+
140+
&i2c0 {
141+
pinctrl-0 = <&i2c0_default>;
142+
pinctrl-names = "default";
143+
};
144+
145+
&gpio {
146+
location-swo = <0>;
147+
status = "okay";
148+
};
149+
150+
&gpioa {
151+
status = "okay";
152+
};
153+
154+
&gpiob {
155+
status = "okay";
156+
};
157+
158+
&gpioc {
159+
status = "okay";
160+
};
161+
162+
&gpiod {
163+
status = "okay";
164+
};
165+
166+
&wdog0 {
167+
status = "okay";
168+
};
169+
170+
&sysrtc0 {
171+
status = "okay";
172+
};
173+
174+
&se {
175+
status = "okay";
176+
};
177+
178+
&flash0 {
179+
partitions {
180+
compatible = "fixed-partitions";
181+
#address-cells = <1>;
182+
#size-cells = <1>;
183+
184+
/* Reserve 48 kB for the bootloader */
185+
boot_partition: partition@0 {
186+
reg = <0x0 DT_SIZE_K(48)>;
187+
label = "mcuboot";
188+
read-only;
189+
};
190+
191+
/* Reserve 736 kB for the application in slot 0 */
192+
slot0_partition: partition@c000 {
193+
reg = <0x0000c000 0x000B8000>;
194+
label = "image-0";
195+
};
196+
197+
/* Reserve 736 kB for the application in slot 1 */
198+
slot1_partition: partition@C4000 {
199+
reg = <0x000C4000 0x000B8000>;
200+
label = "image-1";
201+
};
202+
203+
/* Set 16 kB of storage at the end of the 1536 kB of flash */
204+
storage_partition: partition@17c000 {
205+
reg = <0x0017c000 DT_SIZE_K(16)>;
206+
label = "storage";
207+
};
208+
};
209+
};
210+
211+
&bt_hci_silabs {
212+
status = "okay";
213+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
identifier: arduino_nano_matter
2+
name: Arduino Nano Matter
3+
type: mcu
4+
arch: arm
5+
ram: 256
6+
flash: 1536
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
supported:
11+
- bluetooth
12+
- gpio
13+
- uart
14+
- dma
15+
- watchdog
16+
- comparator
17+
testing:
18+
ignore_tags:
19+
- pm
20+
vendor: arduino
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2025 Peter Johanson
3+
* Copyright (c) 2025 Silicon Laboratories Inc.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/ {
9+
arduino_nano_matter_d: connector {
10+
compatible = "arduino,arduino_nano_matter-gpio";
11+
#gpio-cells = <2>;
12+
gpio-map-mask = <0xffffffff 0xffffffc0>;
13+
gpio-map-pass-thru = <0 0x3f>;
14+
gpio-map = <0 0 &gpioa 4 0>, /* D0 */
15+
<1 0 &gpioa 5 0>, /* D1 */
16+
<2 0 &gpioa 3 0>, /* D2 */
17+
<3 0 &gpioc 6 0>, /* D3 */
18+
<4 0 &gpioc 7 0>, /* D4 */
19+
<5 0 &gpioc 8 0>, /* D5 */
20+
<6 0 &gpioc 9 0>, /* D6 */
21+
<7 0 &gpiod 2 0>, /* D7 */
22+
<8 0 &gpiod 3 0>, /* D8 */
23+
<9 0 &gpiod 4 0>, /* D9 */
24+
<10 0 &gpiod 5 0>, /* D10 */
25+
<11 0 &gpioa 9 0>, /* D11 */
26+
<12 0 &gpioa 8 0>, /* D12 */
27+
<13 0 &gpiob 4 0>, /* D13 */
28+
<14 0 &gpiob 0 0>, /* A0 */
29+
<15 0 &gpiob 2 0>, /* A1 */
30+
<16 0 &gpiob 5 0>, /* A2 */
31+
<17 0 &gpioc 0 0>, /* A3 */
32+
<18 0 &gpioa 6 0>, /* A4 */
33+
<19 0 &gpioa 7 0>, /* A5 */
34+
<20 0 &gpiob 1 0>, /* A6 */
35+
<21 0 &gpiob 3 0>; /* A7 */
36+
};
37+
};
38+
39+
arduino_nano_matter_spi: &eusart1 {};
40+
41+
arduino_nano_matter_serial: &eusart0 {};
42+
43+
arduino_nano_matter_i2c: &i2c0 {};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_ARM_MPU=y
4+
CONFIG_CONSOLE=y
5+
CONFIG_UART_CONSOLE=y
6+
CONFIG_SERIAL=y
7+
CONFIG_GPIO=y
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(openocd)
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
5+
6+
board_runner_args(jlink "--device=MGM240SD22VNA")
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

0 commit comments

Comments
 (0)