Skip to content

Commit 6f7bbf7

Browse files
raveiouskartben
authored andcommitted
boards: Adding Adafruit QT Py ESP32s3 support.
This adds support for the ESP32s3 based Adafruit QT Py, as well as its PSRAM variant. Signed-off-by: Ian Wakely <[email protected]>
1 parent ab948b0 commit 6f7bbf7

21 files changed

+794
-0
lines changed

boards/adafruit/qt_py_esp32s3/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2024 Ian Wakely
2+
3+
config HEAP_MEM_POOL_ADD_SIZE_BOARD
4+
int
5+
default 4096 if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_PROCPU
6+
default 256 if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_APPCPU
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Adafruit ESP32S3 board configuration
2+
3+
# Copyright (c) 2024 Ian Wakely
4+
5+
config BOARD_ADAFRUIT_QT_PY_ESP32S3
6+
select SOC_ESP32S3_WROOM_N8 if "$(BOARD_REVISION)" = ""
7+
select SOC_ESP32S3_WROOM_N4R2 if "$(BOARD_REVISION)" = "psram"
8+
select SOC_ESP32S3_PROCPU if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_PROCPU
9+
select SOC_ESP32S3_APPCPU if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_APPCPU
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
choice BOOTLOADER
5+
default BOOTLOADER_MCUBOOT
6+
endchoice
7+
8+
choice BOOT_SIGNATURE_TYPE
9+
default BOOT_SIGNATURE_TYPE_NONE
10+
endchoice
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
8+
#include <dt-bindings/pinctrl/esp32s3-pinctrl.h>
9+
#include <zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h>
10+
11+
&pinctrl {
12+
uart0_default: uart0_default {
13+
group1 {
14+
pinmux = <UART0_TX_GPIO5>;
15+
output-high;
16+
};
17+
group2 {
18+
pinmux = <UART0_RX_GPIO16>;
19+
bias-pull-up;
20+
};
21+
};
22+
23+
spim2_default: spim2_default {
24+
group1 {
25+
pinmux = <SPIM2_MISO_GPIO37>,
26+
<SPIM2_SCLK_GPIO36>;
27+
};
28+
group2 {
29+
pinmux = <SPIM2_MOSI_GPIO35>;
30+
output-low;
31+
};
32+
};
33+
34+
spim3_ws2812_led: spim3_ws2812_led {
35+
group1 {
36+
pinmux = <SPIM3_MOSI_GPIO39>;
37+
output-low;
38+
};
39+
};
40+
41+
i2c0_default: i2c0_default {
42+
group1 {
43+
pinmux = <I2C0_SDA_GPIO7>,
44+
<I2C0_SCL_GPIO6>;
45+
bias-pull-up;
46+
drive-open-drain;
47+
output-high;
48+
};
49+
};
50+
51+
i2c1_default: i2c1_default {
52+
group1 {
53+
pinmux = <I2C1_SDA_GPIO41>,
54+
<I2C1_SCL_GPIO40>;
55+
bias-pull-up;
56+
drive-open-drain;
57+
output-high;
58+
};
59+
};
60+
61+
twai_default: twai_default {
62+
group1 {
63+
pinmux = <TWAI_TX_GPIO9>,
64+
<TWAI_RX_GPIO8>;
65+
};
66+
};
67+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2024 Ian Wakely
3+
*/
4+
5+
/dts-v1/;
6+
7+
#include <espressif/esp32s3/esp32s3_wroom_n8.dtsi>
8+
#include "adafruit_qt_py_esp32s3-pinctrl.dtsi"
9+
#include <espressif/partitions_0x0_amp.dtsi>
10+
11+
/ {
12+
model = "Adafruit QT Py ESP32S3 APPCPU";
13+
compatible = "espressif,esp32s3";
14+
15+
chosen {
16+
zephyr,sram = &sram1;
17+
zephyr,ipc_shm = &shm0;
18+
zephyr,ipc = &ipm0;
19+
zephyr,flash = &flash0;
20+
zephyr,code-partition = &slot0_appcpu_partition;
21+
};
22+
};
23+
24+
&trng0 {
25+
status = "okay";
26+
};
27+
28+
&ipm0 {
29+
status = "okay";
30+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
identifier: adafruit_qt_py_esp32s3/esp32s3/appcpu
2+
name: Adafruit QT Py ESP32S3 APPCPU
3+
type: mcu
4+
arch: xtensa
5+
toolchain:
6+
- zephyr
7+
supported:
8+
- uart
9+
testing:
10+
ignore_tags:
11+
- net
12+
- bluetooth
13+
- flash
14+
- cpp
15+
- posix
16+
- watchdog
17+
- logging
18+
- kernel
19+
- pm
20+
- gpio
21+
- crypto
22+
- eeprom
23+
- heap
24+
- cmsis_rtos
25+
- jwt
26+
- zdsp
27+
vendor: adafruit
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_MAIN_STACK_SIZE=2048
4+
CONFIG_CLOCK_CONTROL=y
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2024 Ian Wakely
3+
*/
4+
5+
/delete-node/ &flash0;
6+
7+
/ {
8+
model = "Adafruit QT Py ESP32S3 PSRAM APPCPU";
9+
10+
soc {
11+
flash: flash-controller@60002000 {
12+
compatible = "espressif,esp32-flash-controller";
13+
reg = <0x60002000 0x1000>;
14+
#address-cells = <1>;
15+
#size-cells = <1>;
16+
17+
/* 4MB flash */
18+
flash0: flash@0 {
19+
compatible = "soc-nv-flash";
20+
erase-block-size = <4096>;
21+
write-block-size = <4>;
22+
reg = <0x0 DT_SIZE_M(4)>;
23+
};
24+
};
25+
};
26+
};
27+
28+
/* 2MB psram */
29+
&psram0 {
30+
reg = <0x3c000000 DT_SIZE_M(2)>;
31+
status = "okay";
32+
};
33+
34+
#include <espressif/partitions_0x0_amp.dtsi>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
identifier: adafruit_qt_py_esp32s3@psram/esp32s3/appcpu
2+
name: Adafruit QT Py ESP32S3 PSRAM APPCPU
3+
type: mcu
4+
arch: xtensa
5+
toolchain:
6+
- zephyr
7+
supported:
8+
- uart
9+
testing:
10+
ignore_tags:
11+
- net
12+
- bluetooth
13+
- flash
14+
- cpp
15+
- posix
16+
- watchdog
17+
- logging
18+
- kernel
19+
- pm
20+
- gpio
21+
- crypto
22+
- eeprom
23+
- heap
24+
- cmsis_rtos
25+
- jwt
26+
- zdsp
27+
vendor: adafruit
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/*
2+
* Copyright (c) 2023 Seeed Studio inc.
3+
* Copyright (c) 2024 Ian Wakely
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include <espressif/esp32s3/esp32s3_wroom_n8.dtsi>
11+
#include <zephyr/dt-bindings/led/led.h>
12+
#include <zephyr/dt-bindings/input/input-event-codes.h>
13+
#include "adafruit_qt_py_esp32s3-pinctrl.dtsi"
14+
#include "seeed_xiao_connector.dtsi"
15+
#include <espressif/partitions_0x0_amp.dtsi>
16+
17+
/ {
18+
model = "Adafruit QT Py ESP32S3 PROCPU";
19+
compatible = "seeed,xiao-esp32s3";
20+
21+
chosen {
22+
zephyr,sram = &sram1;
23+
zephyr,console = &usb_serial;
24+
zephyr,shell-uart = &usb_serial;
25+
zephyr,flash = &flash0;
26+
zephyr,code-partition = &slot0_partition;
27+
zephyr,bt-hci = &esp32_bt_hci;
28+
};
29+
30+
aliases {
31+
i2c-0 = &i2c0;
32+
watchdog0 = &wdt0;
33+
led-strip = &led_strip;
34+
sw0 = &button0;
35+
};
36+
37+
buttons {
38+
compatible = "gpio-keys";
39+
button0: button_0 {
40+
gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
41+
label = "User button";
42+
zephyr,code = <INPUT_KEY_0>;
43+
};
44+
};
45+
};
46+
47+
&usb_serial {
48+
status = "okay";
49+
};
50+
51+
&uart0 {
52+
status = "okay";
53+
current-speed = <115200>;
54+
pinctrl-0 = <&uart0_default>;
55+
pinctrl-names = "default";
56+
};
57+
58+
&i2c0 {
59+
status = "okay";
60+
clock-frequency = <I2C_BITRATE_STANDARD>;
61+
pinctrl-0 = <&i2c0_default>;
62+
pinctrl-names = "default";
63+
};
64+
65+
&i2c1 {
66+
status = "okay";
67+
clock-frequency = <I2C_BITRATE_STANDARD>;
68+
pinctrl-0 = <&i2c1_default>;
69+
pinctrl-names = "default";
70+
};
71+
72+
&trng0 {
73+
status = "okay";
74+
};
75+
76+
&spi2 {
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
status = "okay";
80+
pinctrl-0 = <&spim2_default>;
81+
pinctrl-names = "default";
82+
};
83+
84+
&spi3 {
85+
#address-cells = <1>;
86+
#size-cells = <0>;
87+
status = "okay";
88+
pinctrl-0 = <&spim3_ws2812_led>;
89+
pinctrl-names = "default";
90+
91+
line-idle-low;
92+
93+
led_strip: ws2812@0 {
94+
compatible = "worldsemi,ws2812-spi";
95+
96+
/* SPI */
97+
reg = <0>; /* ignored, but necessary for SPI bindings */
98+
spi-max-frequency = <6400000>;
99+
100+
/* WS2812 */
101+
chain-length = <1>;
102+
spi-cpha;
103+
spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */
104+
spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */
105+
color-mapping = <LED_COLOR_ID_GREEN
106+
LED_COLOR_ID_RED
107+
LED_COLOR_ID_BLUE>;
108+
};
109+
};
110+
111+
&gpio0 {
112+
status = "okay";
113+
};
114+
115+
&gpio1 {
116+
status = "okay";
117+
118+
/*
119+
* Unlike some of the other Adafruit boards, the neopixel on this board has
120+
* its positive side hooked up to a GPIO pin rather than a positive voltage
121+
* rail to save on power. This will enable the LED on board initialization.
122+
*/
123+
neopixel-power-enable {
124+
gpio-hog;
125+
gpios = <6 GPIO_ACTIVE_HIGH>;
126+
output-high;
127+
};
128+
};
129+
130+
&wdt0 {
131+
status = "okay";
132+
};
133+
134+
&twai {
135+
pinctrl-0 = <&twai_default>;
136+
pinctrl-names = "default";
137+
};
138+
139+
&timer0 {
140+
status = "okay";
141+
};
142+
143+
&timer1 {
144+
status = "okay";
145+
};
146+
147+
&esp32_bt_hci {
148+
status = "okay";
149+
};

0 commit comments

Comments
 (0)