Skip to content

Commit 9e7b214

Browse files
committed
boards: adafruit: esp32s2_feather: add support
add board support for adafruit_esp32s2_feather series Signed-off-by: Philipp Steiner <[email protected]>
1 parent d9aab69 commit 9e7b214

File tree

48 files changed

+1737
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1737
-0
lines changed
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+
zephyr_library()
4+
zephyr_library_sources(board.c)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2023 Google, LLC
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config HEAP_MEM_POOL_ADD_SIZE_BOARD
5+
int
6+
default 4096
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 BOARD_ADAFRUIT_FEATHER
4+
select SOC_ESP32S2_R2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2024 Leon Rinkel <[email protected]>
2+
# Copyright (c) 2025 Philipp Steiner <[email protected]>
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config ENTROPY_GENERATOR
6+
default y
7+
8+
if BOARD_ADAFRUIT_FEATHER
9+
10+
if DISPLAY
11+
12+
config BOARD_ADAFRUIT_FEATHER
13+
select BOARD_LATE_INIT_HOOK
14+
15+
select BOARD_LATE_INIT_HOOK
16+
17+
choice ST7789V_PIXEL_FORMAT
18+
default ST7789V_RGB565
19+
endchoice
20+
21+
if LVGL
22+
23+
config LV_Z_BITS_PER_PIXEL
24+
default 16
25+
26+
choice LV_COLOR_DEPTH
27+
default LV_COLOR_DEPTH_16
28+
endchoice
29+
30+
config LV_COLOR_16_SWAP
31+
default y
32+
33+
endif # LVGL
34+
35+
endif # DISPLAY
36+
37+
endif # BOARD_ADAFRUIT_FEATHER
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: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright (c) 2025 Philipp Steiner <[email protected]>.
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/esp32s2-pinctrl.h>
9+
#include <zephyr/dt-bindings/pinctrl/esp32s2-gpio-sigmap.h>
10+
11+
&pinctrl {
12+
13+
/* Debug TX (DBG) - This is the hardware UART debug pin */
14+
uart0_default: uart0_default {
15+
group1 {
16+
pinmux = <UART0_TX_GPIO43>;
17+
output-high;
18+
};
19+
};
20+
21+
uart1_default: uart1_default {
22+
group1 {
23+
pinmux = <UART1_TX_GPIO39>;
24+
output-high;
25+
};
26+
group2 {
27+
pinmux = <UART1_RX_GPIO38>;
28+
bias-pull-up;
29+
};
30+
};
31+
32+
spim2_default: spim2_default {
33+
group1 {
34+
pinmux = <SPIM2_MISO_GPIO37>,
35+
<SPIM2_SCLK_GPIO36>,
36+
<SPIM2_CSEL_GPIO7>;
37+
};
38+
group2 {
39+
pinmux = <SPIM2_MOSI_GPIO35>;
40+
output-low;
41+
};
42+
};
43+
44+
spim3_ws2812_led: spim3_ws2812_led {
45+
group1 {
46+
pinmux = <SPIM3_MOSI_GPIO33>;
47+
};
48+
};
49+
50+
i2c0_default: i2c0_default {
51+
group1 {
52+
pinmux = <I2C0_SDA_GPIO3>,
53+
<I2C0_SCL_GPIO4>;
54+
drive-open-drain;
55+
output-high;
56+
};
57+
};
58+
59+
twai_default: twai_default {
60+
group1 {
61+
pinmux = <TWAI_TX_GPIO5>,
62+
<TWAI_RX_GPIO6>;
63+
};
64+
};
65+
};
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
/*
2+
* Copyright (c) 2025 Philipp Steiner <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <espressif/esp32s2/esp32s2_wroom.dtsi>
10+
#include "adafruit_feather_esp32s2-pinctrl.dtsi"
11+
#include <espressif/partitions_0x1000_default.dtsi>
12+
#include <zephyr/dt-bindings/input/input-event-codes.h>
13+
#include <dt-bindings/led/led.h>
14+
#include <dt-bindings/led/worldsemi_ws2812c.h>
15+
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
16+
17+
/ {
18+
compatible = "espressif,esp32s2";
19+
20+
chosen {
21+
zephyr,sram = &sram1;
22+
/*
23+
* uart1 is used as the default uart for zephyr,console and zephyr,shell,
24+
* because USB-OTG is until now not supported and USB-CDC is not available for ESP32-S2.
25+
* See issue #29394 - ESP32 development overview
26+
* To use uart1 a FTDI-USB-RS232 or similar needs to be connected to the RX/TX pins.
27+
* See feather_connector.dtsi
28+
*/
29+
zephyr,console = &uart1;
30+
zephyr,shell-uart = &uart1;
31+
zephyr,flash = &flash0;
32+
zephyr,code-partition = &slot0_partition;
33+
};
34+
35+
aliases {
36+
led0 = &led0;
37+
i2c-0 = &i2c0;
38+
sw0 = &user_button;
39+
led-strip = &led_strip;
40+
watchdog0 = &wdt0;
41+
};
42+
43+
leds {
44+
compatible = "gpio-leds";
45+
status = "okay";
46+
47+
led0: led_0 {
48+
label = "Red-LED";
49+
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
50+
};
51+
};
52+
53+
gpio_keys {
54+
compatible = "gpio-keys";
55+
status = "okay";
56+
user_button: user_button {
57+
label = "BOOT Button";
58+
gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
59+
zephyr,code = <INPUT_KEY_0>;
60+
};
61+
};
62+
};
63+
64+
&uart0 {
65+
status = "okay";
66+
current-speed = <115200>;
67+
pinctrl-0 = <&uart0_default>;
68+
pinctrl-names = "default";
69+
};
70+
71+
&uart1 {
72+
status = "okay";
73+
current-speed = <115200>;
74+
pinctrl-0 = <&uart1_default>;
75+
pinctrl-names = "default";
76+
};
77+
78+
&gpio0 {
79+
status = "okay";
80+
neopixel-power-enable {
81+
gpio-hog;
82+
gpios = <21 GPIO_ACTIVE_HIGH>;
83+
output-high;
84+
};
85+
};
86+
87+
&gpio1 {
88+
status = "okay";
89+
};
90+
91+
&timer0 {
92+
status = "okay";
93+
};
94+
95+
&timer1 {
96+
status = "okay";
97+
};
98+
99+
&timer2 {
100+
status = "okay";
101+
};
102+
103+
&timer3 {
104+
status = "okay";
105+
};
106+
107+
&i2c0 {
108+
status = "okay";
109+
clock-frequency = <I2C_BITRATE_STANDARD>;
110+
pinctrl-0 = <&i2c0_default>;
111+
pinctrl-names = "default";
112+
};
113+
114+
&trng0 {
115+
status = "okay";
116+
};
117+
118+
&spi2 {
119+
#address-cells = <1>;
120+
#size-cells = <0>;
121+
status = "okay";
122+
pinctrl-0 = <&spim2_default>;
123+
pinctrl-names = "default";
124+
};
125+
126+
&spi3 {
127+
#address-cells = <1>;
128+
#size-cells = <0>;
129+
status = "okay";
130+
pinctrl-0 = <&spim3_ws2812_led>;
131+
pinctrl-names = "default";
132+
133+
line-idle-low;
134+
135+
led_strip: ws2812@0 {
136+
compatible = "worldsemi,ws2812-spi";
137+
138+
/* SPI */
139+
reg = <0>; /* ignored, but necessary for SPI bindings */
140+
spi-max-frequency = <6400000>;
141+
142+
/* WS2812 */
143+
chain-length = <1>;
144+
spi-cpha;
145+
spi-one-frame = <WS2812C_ONE_FRAME>; /* 11110000: 625 ns high and 625 ns low */
146+
spi-zero-frame = <WS2812C_ZERO_FRAME>; /* 11000000: 312.5 ns high and 937.5 ns low */
147+
color-mapping = <LED_COLOR_ID_GREEN>,
148+
<LED_COLOR_ID_RED>,
149+
<LED_COLOR_ID_BLUE>;
150+
};
151+
};
152+
153+
154+
&twai {
155+
pinctrl-0 = <&twai_default>;
156+
pinctrl-names = "default";
157+
};
158+
159+
&wdt0 {
160+
status = "okay";
161+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2025 Philipp Steiner <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "adafruit_feather_esp32s2_common.dtsi"
10+
#include "feather_connector.dtsi"
11+
12+
/ {
13+
model = "Adafruit Feather ESP32-S2 Rev B";
14+
compatible = "adafruit,feather-esp32s2-revb";
15+
16+
/*
17+
* On-board transistor powers I2C pull-ups and external devices connected
18+
* via the STEMMA QT connector.
19+
*/
20+
i2c_reg: i2c_reg {
21+
label = "I2C Power";
22+
compatible = "power-domain-gpio";
23+
#power-domain-cells = <0>;
24+
enable-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
25+
};
26+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
identifier: adafruit_feather_esp32s2/revb
2+
name: Adafruit Feather ESP32-S2 Rev B
3+
type: mcu
4+
arch: xtensa
5+
toolchain:
6+
- zephyr
7+
supported:
8+
- gpio
9+
- uart
10+
- i2c
11+
- spi
12+
- counter
13+
- watchdog
14+
- entropy
15+
- pwm
16+
- dma
17+
vendor: adafruit
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+
CONFIG_MAIN_STACK_SIZE=2048
4+
CONFIG_CONSOLE=y
5+
CONFIG_SERIAL=y
6+
CONFIG_UART_CONSOLE=y
7+
CONFIG_GPIO=y
8+
CONFIG_CLOCK_CONTROL=y

0 commit comments

Comments
 (0)