Skip to content

Commit faa2f19

Browse files
committed
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. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
1 parent b9e8333 commit faa2f19

File tree

13 files changed

+601
-1
lines changed

13 files changed

+601
-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: 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(jlink "--device=nRF52840_xxAA" "--speed=4000")
4+
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
5+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
6+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
7+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
522 KB
Loading

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

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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 a bootloader. However, this guide doesn't describe how
86+
to use it and instead an External Debug Probe is used in order to program the
87+
board. If you have one, you can also use an external :ref:`debug probe
88+
<debug-probes>` to flash and debug Zephyr applications, but you need to solder
89+
an SWD header onto the back side of the board.
90+
91+
For Segger J-Link debug probes, follow the instructions in the
92+
:ref:`jlink-external-debug-probe` page to install and configure all the
93+
necessary software.
94+
95+
Flashing
96+
========
97+
98+
Follow the instructions in the :ref:`jlink-external-debug-probe` page to install
99+
and configure all the necessary software. Then build and flash applications as
100+
usual (see :ref:`build_an_application` and :ref:`application_run` for more
101+
details).
102+
103+
Here is an example for the :ref:`hello_world` application.
104+
105+
First, run your favorite terminal program to listen for output.
106+
107+
.. code-block:: console
108+
109+
$ minicom -D <tty_device> -b 115200
110+
111+
Replace :code:`<tty_device>` with the port where the board XIAO BLE
112+
can be found. For example, under Linux, :code:`/dev/ttyACM0`.
113+
114+
Then build and flash the application in the usual way. Just add
115+
``CONFIG_BOOT_DELAY=5000`` to the configuration, so that USB CDC ACM is
116+
initialized before any text is printed, as below:
117+
118+
.. zephyr-app-commands::
119+
:zephyr-app: samples/hello_world
120+
:board: xiao_ble
121+
:goals: build flash
122+
:gen-args: -DCONFIG_BOOT_DELAY=5000
123+
124+
Debugging
125+
=========
126+
127+
Refer to the :ref:`jlink-external-debug-probe` page to learn about debugging
128+
boards with a Segger IC.
129+
130+
Testing the LEDs in the XIAO BLE
131+
********************************
132+
133+
There is a sample that allows to test that LEDs on the board are working
134+
properly with Zephyr:
135+
136+
.. zephyr-app-commands::
137+
:zephyr-app: samples/basic/blinky
138+
:board: xiao_ble
139+
:goals: build flash
140+
141+
You can build and flash the examples to make sure Zephyr is running correctly on
142+
your board. The LED definitions can be found in
143+
:zephyr_file:`boards/arm/xiao_ble/xiao_ble.dts`.
144+
145+
Testing shell over USB in the XIAO BLE
146+
**************************************
147+
148+
There is a sample that allows to test shell interface over USB CDC ACM interface
149+
with Zephyr:
150+
151+
.. zephyr-app-commands::
152+
:zephyr-app: samples/subsys/shell/shell_module
153+
:board: xiao_ble
154+
:goals: build flash
155+
156+
References
157+
**********
158+
159+
.. target-notes::
160+
161+
.. _XIAO BLE wiki: https://wiki.seeedstudio.com/XIAO_BLE/
162+
.. _pinouts: https://wiki.seeedstudio.com/XIAO_BLE/#hardware-overview
163+
.. _schematic: https://wiki.seeedstudio.com/XIAO_BLE/#resources
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)