Skip to content

Commit ea3f239

Browse files
petejohansonkartben
authored andcommitted
boards: seeed: Add XIAO MG24
Add the basic XIAO MG24 board definition. Signed-off-by: Peter Johanson <[email protected]>
1 parent aa690fa commit ea3f239

13 files changed

+525
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2020 Piotr Mienkowski
2+
# Copyright (c) 2020 TriaGnoSys GmbH
3+
# Copyright (c) 2025 Pete Johanson
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_XIAO_MG24
7+
8+
config LOG_BACKEND_SWO_FREQ_HZ
9+
default 875000
10+
depends on LOG_BACKEND_SWO
11+
12+
if SOC_GECKO_USE_RAIL
13+
14+
config FPU
15+
default y
16+
17+
endif # SOC_GECKO_USE_RAIL
18+
19+
if BT
20+
21+
# Used to enable RF switch and selection
22+
config GPIO_HOGS
23+
default y
24+
25+
config FPU
26+
default y
27+
28+
config COMMON_LIBC_MALLOC_ARENA_SIZE
29+
default 8192
30+
31+
config MAIN_STACK_SIZE
32+
default 3072 if PM
33+
default 2304
34+
35+
endif # BT
36+
37+
endif # BOARD_XIAO_MG24
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2020 Piotr Mienkowski
2+
# Copyright (c) 2020 TriaGnoSys GmbH
3+
# Copyright (c) 2025 Pete Johanson
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_XIAO_MG24
7+
select SOC_PART_NUMBER_EFR32MG24B220F1536IM48

boards/seeed/xiao_mg24/board.cmake

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=EFR32MG24BxxxF1536")
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/seeed/xiao_mg24/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: xiao_mg24
3+
full_name: XIAO MG24
4+
vendor: seeed
5+
socs:
6+
- name: efr32mg24b220f1536im48

boards/seeed/xiao_mg24/doc/index.rst

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
.. zephyr:board:: xiao_mg24
2+
3+
Overview
4+
********
5+
6+
Seeed Studio XIAO MG24 is a mini development board based on Silicon Labs' MG24. XIAO MG24 is based
7+
on ARM Cortex-M33 core, 32-bit RISC architecture with a maximum clock speed of 78MHz, supporting DSP
8+
instructions and FPU floating-point operations, possessing powerful computing power, and built-in
9+
AL/ML hardware accelerator MVP, which can efficiently process AI/machine learning algorithms.
10+
Secondly, it has excellent RF performance, with a transmission power of up to+19.5 dBm and a
11+
reception sensitivity as low as -105.4 dBm. It supports multiple IoT and wireless transmission
12+
protocols such as Matter, Thread, Zigbee, Bluetooth LE 5.3,Bluetooth mesh etc.
13+
14+
Hardware
15+
********
16+
17+
- EFR32MG24B220F1536IM48 Mighty Gecko SoC
18+
- CPU core: ARM Cortex®-M33 with FPU
19+
- Flash memory: 1536 kB
20+
- RAM: 256 kB
21+
- Transmit power: up to +20 dBm
22+
- Operation frequency: 2.4 GHz
23+
- Crystals for LFXO (32.768 kHz) and HFXO (39 MHz).
24+
- 3.7v LiPo power and charge support
25+
- User and battery charge LEDs
26+
27+
For more information about the EFR32MG24 SoC and XIAO MG24 board, refer to these
28+
documents:
29+
30+
- `EFR32MG24 Website`_
31+
- `EFR32MG24 Datasheet`_
32+
- `EFR32xG24 Reference Manual`_
33+
- `XIAO MG24 Wiki`_
34+
35+
Supported Features
36+
==================
37+
38+
.. zephyr:board-supported-hw::
39+
40+
Connections and IOs
41+
===================
42+
43+
In the following table, the column **Name** contains Pin names. For example, PA2
44+
means Pin number 2 on PORTA, as used in the board's datasheets and manuals.
45+
46+
+-------+-------------+------------------+
47+
| Name | Function | Usage |
48+
+=======+=============+==================+
49+
| PA7 | GPIO | LED0 |
50+
+-------+-------------+------------------+
51+
| PA8 | USART0_TX | UART Console TX |
52+
+-------+-------------+------------------+
53+
| PA9 | USART0_RX | UART Console RX |
54+
+-------+-------------+------------------+
55+
56+
The default configuration can be found in
57+
:zephyr_file:`boards/seeed/xiao_mg24/xiao_mg24_defconfig`
58+
59+
System Clock
60+
============
61+
62+
The EFR32MG24 SoC is configured to use the 39 MHz external oscillator on the
63+
board.
64+
65+
Serial Port
66+
===========
67+
68+
The EFR32MG24 SoC has one USART and two EUSARTs.
69+
USART0 is connected to the board controller and is used for the console.
70+
71+
Programming and Debugging
72+
*************************
73+
74+
The XIAO MG24 contains an SAMD11 with CMSIS-DAP, allowing flashing, debugging, logging, etc. over
75+
the USB port. Doing so requires a version of OpenOCD that includes support for the flash on the MG24
76+
MCU. Until those changes are included in stock OpenOCD, the version bundled with Arduino can be
77+
used, or can be installed from the `OpenOCD Arduino Fork`_. When flashing, debugging, etc. you may
78+
need to include ``--openocd=/usr/local/bin/openocd
79+
--openocd-search=/usr/local/share/openocd/scripts/`` options to the command.
80+
81+
Flashing
82+
========
83+
84+
Connect the XIAO MG24 board to your host computer using the USB port. A USB CDC ACM serial port
85+
should appear on the host, that can be used to view logs from the flashed application.
86+
87+
Here is an example for the :zephyr:code-sample:`hello_world` application.
88+
89+
.. zephyr-app-commands::
90+
:zephyr-app: samples/hello_world
91+
:board: xiao_mg24
92+
:goals: flash
93+
94+
Open a serial terminal (minicom, putty, etc.) connecting to the UCB CDC ACM serial port.
95+
96+
Reset the board and you should see the following message in the terminal:
97+
98+
.. code-block:: console
99+
100+
Hello World! xiao_mg24
101+
102+
103+
.. _XIAO MG24 Wiki:
104+
https://wiki.seeedstudio.com/xiao_mg24_getting_started/
105+
106+
.. _BRD4187C User Guide:
107+
https://www.silabs.com/documents/public/user-guides/ug526-brd4187c-user-guide.pdf
108+
109+
.. _EFR32MG24 Website:
110+
https://www.silabs.com/wireless/zigbee/efr32mg24-series-2-socs
111+
112+
.. _EFR32MG24 Datasheet:
113+
https://www.silabs.com/documents/public/data-sheets/efr32mg24-datasheet.pdf
114+
115+
.. _EFR32xG24 Reference Manual:
116+
https://www.silabs.com/documents/public/reference-manuals/brd4187c-rm.pdf
117+
118+
.. _OpenOCD Arduino Fork:
119+
https://github.com/facchinm/OpenOCD/tree/arduino-0.12.0-rtx5
37 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2021 Linaro Limited
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# SPI is implemented via usart so node name isn't spi@...
5+
list(APPEND EXTRA_DTC_FLAGS "-Wno-spi_bus_bridge")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 Peter Johanson
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
xiao_d: connector {
9+
compatible = "seeed,xiao-gpio";
10+
#gpio-cells = <2>;
11+
gpio-map-mask = <0xffffffff 0xffffffc0>;
12+
gpio-map-pass-thru = <0 0x3f>;
13+
gpio-map = <0 0 &gpioc 0 0>, /* D0 */
14+
<1 0 &gpioc 1 0>, /* D1 */
15+
<2 0 &gpioc 2 0>, /* D2 */
16+
<3 0 &gpioc 3 0>, /* D3 */
17+
<4 0 &gpioc 4 0>, /* D4 */
18+
<5 0 &gpioc 5 0>, /* D5 */
19+
<6 0 &gpioc 6 0>, /* D6 */
20+
<7 0 &gpioc 7 0>, /* D7 */
21+
<8 0 &gpioa 3 0>, /* D8 */
22+
<9 0 &gpioa 4 0>, /* D9 */
23+
<10 0 &gpioa 5 0>; /* D10 */
24+
};
25+
};
26+
27+
xiao_spi: &eusart1 {};
28+
29+
xiao_serial: &eusart0 {};
30+
31+
xiao_i2c: &i2c0 {};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
if {[info exists env(OPENOCD_INTERFACE)]} {
2+
set INTERFACE $env(OPENOCD_INTERFACE)
3+
} else {
4+
# By default connect over Debug USB port using the CMSIS-DAP interface
5+
set INTERFACE "cmsis-dap"
6+
}
7+
8+
source [find interface/$INTERFACE.cfg]
9+
10+
transport select swd
11+
12+
set CHIPNAME efr32
13+
14+
source [find target/efm32s2_g23.cfg]
15+
16+
$_TARGETNAME configure -event gdb-attach {
17+
echo "Debugger attaching: halting execution"
18+
reset halt
19+
gdb_breakpoint_override hard
20+
}
21+
22+
$_TARGETNAME configure -event gdb-detach {
23+
echo "Debugger detaching: resuming execution"
24+
resume
25+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (c) 2025 Pete Johanson
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/silabs/xg24-pinctrl.h>
8+
9+
&pinctrl {
10+
eusart0_default: eusart0_default {
11+
group0 {
12+
pins = <EUSART1_TX_PC6>;
13+
drive-push-pull;
14+
output-high;
15+
};
16+
17+
group1 {
18+
pins = <EUSART1_RX_PC7>;
19+
input-enable;
20+
silabs,input-filter;
21+
};
22+
};
23+
24+
eusart1_default: eusart1_default {
25+
group0 {
26+
pins = <EUSART1_TX_PA5>, <EUSART1_SCLK_PA3>;
27+
drive-push-pull;
28+
output-high;
29+
};
30+
31+
group1 {
32+
pins = <EUSART1_RX_PA4>;
33+
input-enable;
34+
silabs,input-filter;
35+
};
36+
};
37+
38+
usart0_default: usart0_default {
39+
group0 {
40+
pins = <USART0_TX_PA8>;
41+
drive-push-pull;
42+
output-high;
43+
};
44+
45+
group1 {
46+
pins = <USART0_RX_PA9>;
47+
input-enable;
48+
silabs,input-filter;
49+
};
50+
};
51+
52+
i2c0_default: i2c0_default {
53+
group0 {
54+
pins = <I2C0_SCL_PC4>, <I2C0_SDA_PC5>;
55+
drive-open-drain;
56+
bias-pull-up;
57+
};
58+
};
59+
};

0 commit comments

Comments
 (0)