Skip to content

Commit 3ebfc42

Browse files
committed
add arm
1 parent ce4c21b commit 3ebfc42

10 files changed

Lines changed: 352 additions & 10 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Seeeduino XIAO BLE board configuration
2+
3+
# Copyright (c) 2022 Peter Johanson
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_ENABLE_DCDC
7+
bool "Enable DCDC mode"
8+
select SOC_DCDC_NRF52X
9+
default y
10+
depends on BOARD_SEEEDUINO_XIAO_BLE
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Seeeduino XIAO BLE board configuration
2+
3+
# Copyright (c) 2022 Peter Johanson
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_SEEEDUINO_XIAO_BLE
7+
bool "Seeeduino XIAO BLE"
8+
depends on SOC_NRF52840_QIAA
9+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Seeeduino XIAO BLE board configuration
2+
3+
# Copyright (c) 2022 Peter Johanson
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD
7+
default "seeeduino_xiao_ble" if BOARD_SEEEDUINO_XIAO_BLE
8+
9+
if BOARD_SEEEDUINO_XIAO_BLE
10+
11+
config BT_CTLR
12+
default BT
13+
14+
endif # BOARD_SEEEDUINO_XIAO_BLE
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(jlink "--device=nrf52" "--speed=4000")
4+
board_runner_args(pyocd "--target=nrf52" "--frequency=4000000")
5+
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
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)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2022 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
14+
= <0 0 &gpio0 2 0> /* D0 */
15+
, <1 0 &gpio0 3 0> /* D1 */
16+
, <2 0 &gpio0 28 0> /* D2 */
17+
, <3 0 &gpio0 29 0> /* D3 */
18+
, <4 0 &gpio0 4 0> /* D4 */
19+
, <5 0 &gpio0 5 0> /* D5 */
20+
, <6 0 &gpio1 11 0> /* D6 */
21+
, <7 0 &gpio1 12 0> /* D7 */
22+
, <8 0 &gpio1 13 0> /* D8 */
23+
, <9 0 &gpio1 14 0> /* D9 */
24+
, <10 0 &gpio1 15 0> /* D10 */
25+
, <11 0 &gpio0 15 0> /* D10 */
26+
, <12 0 &gpio0 19 0> /* D10 */
27+
, <13 0 &gpio1 1 0> /* D10 */
28+
, <14 0 &gpio0 9 0> /* D10 */
29+
, <15 0 &gpio0 10 0> /* D10 */
30+
, <16 0 &gpio0 31 0> /* D10 */
31+
, <17 0 &gpio1 7 0> /* D10 */
32+
, <18 0 &gpio1 5 0> /* D10 */
33+
, <19 0 &gpio1 3 0> /* D10 */
34+
;
35+
};
36+
};
37+
38+
xiao_spi: &spi2 {};
39+
xiao_i2c: &i2c0 {};
40+
xiao_serial: &uart0 {};
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright (c) 2022 Pete Johanson
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+
i2c0_default: i2c0_default {
26+
group1 {
27+
psels = <NRF_PSEL(TWIM_SDA, 0, 4)>,
28+
<NRF_PSEL(TWIM_SCL, 0, 5)>;
29+
};
30+
};
31+
32+
i2c0_sleep: i2c0_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+
spi2_default: spi2_default {
41+
group1 {
42+
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
43+
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
44+
<NRF_PSEL(SPIM_MISO, 1, 14)>;
45+
};
46+
};
47+
48+
spi2_sleep: spi2_sleep {
49+
group1 {
50+
psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
51+
<NRF_PSEL(SPIM_MOSI, 1, 15)>,
52+
<NRF_PSEL(SPIM_MISO, 1, 14)>;
53+
low-power-enable;
54+
};
55+
};
56+
57+
qspi_default: qspi_default {
58+
group1 {
59+
psels = <NRF_PSEL(QSPI_SCK, 0, 21)>,
60+
<NRF_PSEL(QSPI_IO0, 0, 20)>,
61+
<NRF_PSEL(QSPI_IO1, 0, 24)>,
62+
<NRF_PSEL(QSPI_IO2, 0, 22)>,
63+
<NRF_PSEL(QSPI_IO3, 0, 23)>,
64+
<NRF_PSEL(QSPI_CSN, 0, 25)>;
65+
};
66+
};
67+
68+
qspi_sleep: qspi_sleep {
69+
group1 {
70+
psels = <NRF_PSEL(QSPI_SCK, 0, 21)>,
71+
<NRF_PSEL(QSPI_IO0, 0, 20)>,
72+
<NRF_PSEL(QSPI_IO1, 0, 24)>,
73+
<NRF_PSEL(QSPI_IO2, 0, 22)>,
74+
<NRF_PSEL(QSPI_IO3, 0, 23)>;
75+
low-power-enable;
76+
};
77+
group2 {
78+
psels = <NRF_PSEL(QSPI_CSN, 0, 25)>;
79+
low-power-enable;
80+
bias-pull-up;
81+
};
82+
};
83+
};
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/*
2+
* Copyright (c) 2022 Peter Johanson
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <nordic/nrf52840_qiaa.dtsi>
9+
#include "seeeduino_xiao_ble-pinctrl.dtsi"
10+
#include "seeed_xiao_connector.dtsi"
11+
12+
/ {
13+
model = "Seeeduino XIAO BLE";
14+
compatible = "seeed,xiao_ble";
15+
16+
chosen {
17+
zephyr,console = &uart0;
18+
zephyr,shell-uart = &uart0;
19+
zephyr,uart-mcumgr = &uart0;
20+
zephyr,bt-mon-uart = &uart0;
21+
zephyr,bt-c2h-uart = &uart0;
22+
zephyr,sram = &sram0;
23+
zephyr,flash = &flash0;
24+
zephyr,code-partition = &code_partition;
25+
};
26+
27+
/* These aliases are provided for compatibility with samples */
28+
aliases {
29+
led0 = &led0;
30+
led1 = &led1;
31+
led2 = &led2;
32+
};
33+
34+
leds {
35+
compatible = "gpio-leds";
36+
led0: led_0 {
37+
gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
38+
label = "Red LED";
39+
};
40+
led1: led_1 {
41+
gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
42+
label = "Blue LED";
43+
};
44+
led2: led_2 {
45+
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
46+
label = "Green LED";
47+
};
48+
};
49+
};
50+
51+
&gpiote {
52+
status = "okay";
53+
};
54+
55+
&gpio0 {
56+
status = "okay";
57+
};
58+
59+
&gpio1 {
60+
status = "okay";
61+
};
62+
63+
&uart0 {
64+
status = "okay";
65+
compatible = "nordic,nrf-uart";
66+
current-speed = <115200>;
67+
pinctrl-0 = <&uart0_default>;
68+
pinctrl-1 = <&uart0_sleep>;
69+
pinctrl-names = "default", "sleep";
70+
};
71+
72+
&i2c0 {
73+
compatible = "nordic,nrf-twi";
74+
pinctrl-0 = <&i2c0_default>;
75+
pinctrl-1 = <&i2c0_sleep>;
76+
pinctrl-names = "default", "sleep";
77+
};
78+
79+
&spi2 {
80+
compatible = "nordic,nrf-spi";
81+
pinctrl-0 = <&spi2_default>;
82+
pinctrl-1 = <&spi2_sleep>;
83+
pinctrl-names = "default", "sleep";
84+
};
85+
86+
zephyr_udc0: &usbd {
87+
compatible = "nordic,nrf-usbd";
88+
status = "okay";
89+
};
90+
91+
&qspi {
92+
status = "okay";
93+
pinctrl-0 = <&qspi_default>;
94+
pinctrl-1 = <&qspi_sleep>;
95+
pinctrl-names = "default", "sleep";
96+
// TODO: VERIFY THESE!
97+
gd25q16: gd25q16@0 {
98+
/* NOTE: Quad mode not supported as driver does not handle
99+
* QE bit setting in SR2. Ref. GD25Q16C, Rev 3.0, p. 12.
100+
*/
101+
compatible = "nordic,qspi-nor";
102+
reg = <0>;
103+
writeoc = "pp2o";
104+
readoc = "read2io";
105+
sck-frequency = <16000000>;
106+
label = "GD25Q16";
107+
jedec-id = [c8 40 15];
108+
size = <2097152>;
109+
has-dpd;
110+
t-enter-dpd = <20000>;
111+
t-exit-dpd = <20000>;
112+
};
113+
};
114+
115+
116+
&flash0 {
117+
118+
partitions {
119+
compatible = "fixed-partitions";
120+
#address-cells = <1>;
121+
#size-cells = <1>;
122+
123+
sd_partition: partition@0 {
124+
label = "softdevice";
125+
reg = <0x00000000 0x00026000>;
126+
};
127+
128+
code_partition: partition@27000 {
129+
label = "code_partition";
130+
reg = <0x00027000 0x000c5000>;
131+
};
132+
133+
/*
134+
* The flash starting at 0x000ec000 and ending at
135+
* 0x000f3fff is reserved for use by the application.
136+
*/
137+
138+
/*
139+
* Storage partition will be used by FCB/LittleFS/NVS
140+
* if enabled.
141+
*/
142+
storage_partition: partition@ec000 {
143+
label = "storage";
144+
reg = <0x000ec000 0x00008000>;
145+
};
146+
147+
boot_partition: partition@f4000 {
148+
label = "adafruit_boot";
149+
reg = <0x000f4000 0x0000c000>;
150+
};
151+
};
152+
};
153+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
identifier: seeeduino_xiao_ble_nrf52840
2+
name: Seeeduino Xiao BLE nRF52840
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 256
10+
flash: 1024
11+
supported:
12+
- xiao_serial

‎boards/arm/seeeduino_xiao_ble/seeeduino_xiao_ble.zmk.yml‎

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_SOC_SERIES_NRF52X=y
4+
CONFIG_SOC_NRF52840_QIAA=y
5+
CONFIG_BOARD_SEEEDUINO_XIAO_BLE=y
6+
7+
CONFIG_PINCTRL=y
8+
9+
# Enable MPU
10+
CONFIG_ARM_MPU=y
11+
12+
# enable GPIO
13+
CONFIG_GPIO=y
14+
15+
# enable uart driver
16+
CONFIG_SERIAL=y
17+
18+
# enable console
19+
CONFIG_CONSOLE=y
20+
CONFIG_UART_CONSOLE=y
21+
22+
CONFIG_USE_DT_CODE_PARTITION=y
23+
CONFIG_BUILD_OUTPUT_UF2=y

0 commit comments

Comments
 (0)