Skip to content

Commit d32d4af

Browse files
mniestrojpetejohanson
authored andcommitted
boards: arm: add Seeed XIAO BLE board
The Seeed XIAO BLE is a tiny (21 mm x 17.5 mm) Nordic Semiconductor nRF52840 ARM Cortex-M4F development board with onboard LEDs, USB port, QSPI flash, battery charger, and range of I/O broken out into 14 pins. Co-authored-by: Peter Johanson <peter@peterjohanson.com> Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
1 parent 2fd3fce commit d32d4af

File tree

13 files changed

+629
-1
lines changed

13 files changed

+629
-1
lines changed

‎boards/arm/xiao_ble/Kconfig‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# XIAO BLE board configuration
2+
3+
# Copyright (c) 2022 Marcin Niestroj
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_XIAO_BLE
7+
8+
config BOARD_ENABLE_DCDC
9+
bool "DCDC mode"
10+
select SOC_DCDC_NRF52X
11+
default y
12+
13+
config BOARD_ENABLE_DCDC_HV
14+
bool "High Voltage DCDC converter"
15+
select SOC_DCDC_NRF52X_HV
16+
default y
17+
18+
endif # BOARD_XIAO_BLE

‎boards/arm/xiao_ble/Kconfig.board‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# XIAO BLE board configuration
2+
3+
# Copyright (c) 2022 Marcin Niestroj
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_XIAO_BLE
7+
bool "XIAO BLE"
8+
depends on SOC_NRF52840_QIAA
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# XIAO BLE board configuration
2+
3+
# Copyright (c) 2022 Marcin Niestroj
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_XIAO_BLE
7+
8+
config BOARD
9+
default "xiao_ble"
10+
11+
config BT_CTLR
12+
default BT
13+
14+
endif # BOARD_XIAO_BLE
15+
16+
if USB_DEVICE_STACK
17+
18+
config UART_CONSOLE
19+
default CONSOLE
20+
21+
config USB_DEVICE_INITIALIZE_AT_BOOT
22+
default y
23+
24+
endif # USB_DEVICE_STACK

‎boards/arm/xiao_ble/board.cmake‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(nrfjprog "--nrf-family=NRF52")
4+
board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000")
5+
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
6+
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
9+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
522 KB
Loading

‎boards/arm/xiao_ble/doc/index.rst‎

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
.. _xiao_ble:
2+
3+
XIAO BLE
4+
########
5+
6+
Overview
7+
********
8+
9+
The Seeed XIAO BLE is a tiny (21 mm x 17.5 mm) Nordic Semiconductor nRF52840 ARM
10+
Cortex-M4F development board with onboard LEDs, USB port, QSPI flash, battery
11+
charger, and range of I/O broken out into 14 pins.
12+
13+
.. figure:: img/xiao_ble.png
14+
:width: 300px
15+
:align: center
16+
:alt: XIAO BLE
17+
18+
Hardware
19+
********
20+
21+
- Nordic nRF52840 Cortex-M4F processor at 64MHz
22+
- 2MB QSPI Flash
23+
- RGB LED
24+
- USB Type-C Connector, nRF52840 acting as USB device
25+
- Battery charger BQ25101
26+
- Reset button
27+
- Bluetooth antenna
28+
29+
Supported Features
30+
==================
31+
32+
The xiao_ble board configuration supports the following hardware features:
33+
34+
+-----------+------------+----------------------+
35+
| Interface | Controller | Driver/Component |
36+
+===========+============+======================+
37+
| ADC | on-chip | adc |
38+
+-----------+------------+----------------------+
39+
| CLOCK | on-chip | clock_control |
40+
+-----------+------------+----------------------+
41+
| FLASH | on-chip | flash, QSPI flash |
42+
+-----------+------------+----------------------+
43+
| GPIO | on-chip | gpio |
44+
+-----------+------------+----------------------+
45+
| I2C(M) | on-chip | i2c |
46+
+-----------+------------+----------------------+
47+
| MPU | on-chip | arch/arm |
48+
+-----------+------------+----------------------+
49+
| NVIC | on-chip | arch/arm |
50+
+-----------+------------+----------------------+
51+
| PWM | on-chip | pwm |
52+
+-----------+------------+----------------------+
53+
| RADIO | on-chip | Bluetooth, |
54+
| | | ieee802154 |
55+
+-----------+------------+----------------------+
56+
| RTC | on-chip | system clock |
57+
+-----------+------------+----------------------+
58+
| SPI(M/S) | on-chip | spi |
59+
+-----------+------------+----------------------+
60+
| UART | on-chip | serial |
61+
+-----------+------------+----------------------+
62+
| USB | on-chip | usb |
63+
+-----------+------------+----------------------+
64+
| WDT | on-chip | watchdog |
65+
+-----------+------------+----------------------+
66+
67+
Other hardware features have not been enabled yet for this board.
68+
69+
Connections and IOs
70+
===================
71+
72+
The `XIAO BLE wiki`_ has detailed information about the board including
73+
`pinouts`_ and the `schematic`_.
74+
75+
LED
76+
---
77+
78+
* LED1 (red) = P0.26
79+
* LED2 (green) = P0.30
80+
* LED3 (blue) = P0.06
81+
82+
Programming and Debugging
83+
*************************
84+
85+
The XIAO BLE ships with the `Adafruit nRF52 Bootloader`_ which supports flashing
86+
using `UF2`_. Doing so allows easy flashing of new images, but does not support
87+
debugging the device. For debugging please use `External Debugger`_.
88+
89+
UF2 Flashing
90+
============
91+
92+
To enter the bootloader, connect the USB port of the XIAO BLE to your host, and
93+
double tap the reset botton to the left of the USB connector. A mass storage
94+
device named `XIAO BLE` should appear on the host. Using the command line, or
95+
your file manager copy the `zephyr/zephyr.uf2` file from your build to the base
96+
of the `XIAO BLE` mass storage device. The XIAO BLE will automatically reset
97+
and launch the newly flashed application.
98+
99+
External Debugger
100+
=================
101+
102+
In order to support debugging the device, instead of using the bootloader, you
103+
can use an :ref:`External Debug Probe <debug-probes>`. To flash and debug Zephyr
104+
applications you need to use `Seeeduino XIAO Expansion Board`_ or solder an SWD
105+
header onto the back side of the board.
106+
107+
For Segger J-Link debug probes, follow the instructions in the
108+
:ref:`jlink-external-debug-probe` page to install and configure all the
109+
necessary software.
110+
111+
Flashing
112+
--------
113+
114+
Follow the instructions in the :ref:`jlink-external-debug-probe` page to install
115+
and configure all the necessary software. Then build and flash applications as
116+
usual (see :ref:`build_an_application` and :ref:`application_run` for more
117+
details).
118+
119+
Here is an example for the :ref:`hello_world` application.
120+
121+
First, run your favorite terminal program to listen for output.
122+
123+
.. code-block:: console
124+
125+
$ minicom -D <tty_device> -b 115200
126+
127+
Replace :code:`<tty_device>` with the port where the board XIAO BLE
128+
can be found. For example, under Linux, :code:`/dev/ttyACM0`.
129+
130+
Then build and flash the application in the usual way. Just add
131+
``CONFIG_BOOT_DELAY=5000`` to the configuration, so that USB CDC ACM is
132+
initialized before any text is printed, as below:
133+
134+
.. zephyr-app-commands::
135+
:zephyr-app: samples/hello_world
136+
:board: xiao_ble
137+
:goals: build flash
138+
:gen-args: -DCONFIG_BOOT_DELAY=5000
139+
140+
Debugging
141+
---------
142+
143+
Refer to the :ref:`jlink-external-debug-probe` page to learn about debugging
144+
boards with a Segger IC.
145+
146+
Testing the LEDs in the XIAO BLE
147+
********************************
148+
149+
There is a sample that allows to test that LEDs on the board are working
150+
properly with Zephyr:
151+
152+
.. zephyr-app-commands::
153+
:zephyr-app: samples/basic/blinky
154+
:board: xiao_ble
155+
:goals: build flash
156+
157+
You can build and flash the examples to make sure Zephyr is running correctly on
158+
your board. The LED definitions can be found in
159+
:zephyr_file:`boards/arm/xiao_ble/xiao_ble.dts`.
160+
161+
Testing shell over USB in the XIAO BLE
162+
**************************************
163+
164+
There is a sample that allows to test shell interface over USB CDC ACM interface
165+
with Zephyr:
166+
167+
.. zephyr-app-commands::
168+
:zephyr-app: samples/subsys/shell/shell_module
169+
:board: xiao_ble
170+
:goals: build flash
171+
172+
References
173+
**********
174+
175+
.. target-notes::
176+
177+
.. _XIAO BLE wiki: https://wiki.seeedstudio.com/XIAO_BLE/
178+
.. _pinouts: https://wiki.seeedstudio.com/XIAO_BLE/#hardware-overview
179+
.. _schematic: https://wiki.seeedstudio.com/XIAO_BLE/#resources
180+
.. _Seeeduino XIAO Expansion Board: https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/
181+
.. _Adafruit nRF52 Bootloader: https://github.com/adafruit/Adafruit_nRF52_Bootloader
182+
.. _UF2: https://github.com/microsoft/uf2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2022 Nordic Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
5+
# - power@40000000 & clock@40000000 & bprot@40000000
6+
# - acl@4001e000 & flash-controller@4001e000
7+
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2022 Peter Johanson
3+
* Copyright (c) 2022 Marcin Niestroj
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/ {
9+
xiao_d: connector {
10+
compatible = "seeed,xiao-gpio";
11+
#gpio-cells = <2>;
12+
gpio-map-mask = <0xffffffff 0xffffffc0>;
13+
gpio-map-pass-thru = <0 0x3f>;
14+
gpio-map
15+
= <0 0 &gpio0 2 0> /* D0 */
16+
, <1 0 &gpio0 3 0> /* D1 */
17+
, <2 0 &gpio0 28 0> /* D2 */
18+
, <3 0 &gpio0 29 0> /* D3 */
19+
, <4 0 &gpio0 4 0> /* D4 */
20+
, <5 0 &gpio0 5 0> /* D5 */
21+
, <6 0 &gpio1 11 0> /* D6 */
22+
, <7 0 &gpio1 12 0> /* D7 */
23+
, <8 0 &gpio1 13 0> /* D8 */
24+
, <9 0 &gpio1 14 0> /* D9 */
25+
, <10 0 &gpio1 15 0> /* D10 */
26+
;
27+
};
28+
};
29+
30+
xiao_spi: &spi0 {};
31+
xiao_i2c: &i2c1 {};
32+
xiao_serial: &uart0 {};
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Copyright (c) 2022 Marcin Niestroj
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
&pinctrl {
7+
uart0_default: uart0_default {
8+
group1 {
9+
psels = <NRF_PSEL(UART_TX, 1, 11)>;
10+
};
11+
group2 {
12+
psels = <NRF_PSEL(UART_RX, 1, 12)>;
13+
bias-pull-up;
14+
};
15+
};
16+
17+
uart0_sleep: uart0_sleep {
18+
group1 {
19+
psels = <NRF_PSEL(UART_TX, 1, 11)>,
20+
<NRF_PSEL(UART_RX, 1, 12)>;
21+
low-power-enable;
22+
};
23+
};
24+
25+
i2c1_default: i2c1_default {
26+
group1 {
27+
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
28+
<NRF_PSEL(TWIM_SCL, 0, 5)>;
29+
};
30+
};
31+
32+
i2c1_sleep: i2c1_sleep {
33+
group1 {
34+
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
35+
<NRF_PSEL(TWIM_SCL, 0, 5)>;
36+
low-power-enable;
37+
};
38+
};
39+
40+
pwm0_default: pwm0_default {
41+
group1 {
42+
psels = <NRF_PSEL(PWM_OUT0, 0, 17)>;
43+
nordic,invert;
44+
};
45+
};
46+
47+
pwm0_sleep: pwm0_sleep {
48+
group1 {
49+
psels = <NRF_PSEL(PWM_OUT0, 0, 17)>;
50+
low-power-enable;
51+
};
52+
};
53+
54+
spi0_default: spi0_default {
55+
group1 {
56+
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
57+
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
58+
<NRF_PSEL(SPIM_MISO, 1, 14)>;
59+
};
60+
};
61+
62+
spi0_sleep: spi0_sleep {
63+
group1 {
64+
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
65+
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
66+
<NRF_PSEL(SPIM_MISO, 1, 14)>;
67+
low-power-enable;
68+
};
69+
};
70+
71+
spi3_default: spi3_default {
72+
group1 {
73+
psels = <NRF_PSEL(SPIM_SCK, 0, 21)>,
74+
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
75+
<NRF_PSEL(SPIM_MISO, 0, 24)>;
76+
};
77+
};
78+
79+
spi3_sleep: spi3_sleep {
80+
group1 {
81+
psels = <NRF_PSEL(SPIM_SCK, 0, 21)>,
82+
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
83+
<NRF_PSEL(SPIM_MISO, 0, 24)>;
84+
low-power-enable;
85+
};
86+
};
87+
88+
qspi_default: qspi_default {
89+
group1 {
90+
psels = <NRF_PSEL(QSPI_SCK, 0, 21)>,
91+
<NRF_PSEL(QSPI_IO0, 0, 20)>,
92+
<NRF_PSEL(QSPI_IO1, 0, 24)>,
93+
<NRF_PSEL(QSPI_IO2, 0, 22)>,
94+
<NRF_PSEL(QSPI_IO3, 0, 23)>,
95+
<NRF_PSEL(QSPI_CSN, 0, 25)>;
96+
};
97+
};
98+
99+
qspi_sleep: qspi_sleep {
100+
group1 {
101+
psels = <NRF_PSEL(QSPI_SCK, 0, 21)>,
102+
<NRF_PSEL(QSPI_IO0, 0, 20)>,
103+
<NRF_PSEL(QSPI_IO1, 0, 24)>,
104+
<NRF_PSEL(QSPI_IO2, 0, 22)>,
105+
<NRF_PSEL(QSPI_IO3, 0, 23)>,
106+
<NRF_PSEL(QSPI_CSN, 0, 25)>;
107+
low-power-enable;
108+
};
109+
};
110+
};

0 commit comments

Comments
 (0)