Skip to content

Commit 82c3a32

Browse files
committed
boards: adafruit: add initial support for esp32 feather v2
The Adafruit ESP32 Feather V2 is a board that uses the Feather standard layout. It uses an ESP32-PICO v3 02 module, and includes a USB-C connector, LiPo battery charger, NeoPixel RGB LED, and STEMMA QT connector. Signed-off-by: Lena Voytek <lena@voytek.dev>
1 parent b805266 commit 82c3a32

14 files changed

+438
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2025 Lena Voytek <lena@voytek.dev>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config HEAP_MEM_POOL_ADD_SIZE_BOARD
5+
int
6+
default 4096 if BOARD_ADAFRUIT_FEATHER_ESP32_V2_ESP32_PROCPU
7+
default 256 if BOARD_ADAFRUIT_FEATHER_ESP32_V2_ESP32_APPCPU
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Adafruit ESP32 Feather V2 board configuration
2+
3+
# Copyright (c) 2025 Lena Voytek <lena@voytek.dev>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_ADAFRUIT_FEATHER_ESP32_V2
7+
select SOC_ESP32_PICO_V3_02
8+
select SOC_ESP32_PROCPU if BOARD_ADAFRUIT_FEATHER_ESP32_V2_ESP32_PROCPU
9+
select SOC_ESP32_APPCPU if BOARD_ADAFRUIT_FEATHER_ESP32_V2_ESP32_APPCPU
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (c) 2025 Lena Voytek <lena@voytek.dev>
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/esp32-pinctrl.h>
9+
#include <zephyr/dt-bindings/pinctrl/esp32-gpio-sigmap.h>
10+
11+
&pinctrl {
12+
uart0_default: uart0_default {
13+
group1 {
14+
pinmux = <UART0_TX_GPIO1>;
15+
output-high;
16+
};
17+
18+
group2 {
19+
pinmux = <UART0_RX_GPIO3>;
20+
bias-pull-up;
21+
};
22+
};
23+
24+
uart1_default: uart1_default {
25+
group1 {
26+
pinmux = <UART1_TX_GPIO8>;
27+
output-high;
28+
};
29+
30+
group2 {
31+
pinmux = <UART1_RX_GPIO7>;
32+
bias-pull-up;
33+
};
34+
};
35+
36+
spim2_default: spim2_default {
37+
group1 {
38+
pinmux = <SPIM2_MISO_GPIO21>,
39+
<SPIM2_SCLK_GPIO5>;
40+
};
41+
group2 {
42+
pinmux = <SPIM2_MOSI_GPIO19>;
43+
output-low;
44+
};
45+
};
46+
47+
spim3_ws2812_led: spi3_ws2812_led {
48+
group1 {
49+
pinmux = <SPIM3_MOSI_GPIO0>;
50+
};
51+
};
52+
53+
i2c0_default: i2c0_default {
54+
group1 {
55+
pinmux = <I2C0_SDA_GPIO22>,
56+
<I2C0_SCL_GPIO20>;
57+
drive-open-drain;
58+
output-high;
59+
};
60+
};
61+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
8+
#include <espressif/esp32/esp32_appcpu.dtsi>
9+
#include <espressif/partitions_0x1000_amp.dtsi>
10+
11+
/ {
12+
model = "Adafruit ESP32 Feather V2";
13+
compatible = "espressif,esp32";
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+
&ipm0 {
25+
status = "okay";
26+
};
27+
28+
&trng0 {
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_feather_esp32_v2/esp32/appcpu
2+
name: Adafruit ESP32 Feather V2
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_CLOCK_CONTROL=y
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
/*
2+
* Copyright (c) 2025 Lena Voytek <lena@voytek.dev>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
8+
#include <espressif/esp32/esp32_pico_v3_02.dtsi>
9+
#include "adafruit_feather_esp32_v2-pinctrl.dtsi"
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
#include <zephyr/dt-bindings/led/led.h>
12+
#include <zephyr/dt-bindings/led/worldsemi_ws2812c.h>
13+
#include <espressif/partitions_0x1000_amp.dtsi>
14+
15+
/ {
16+
model = "Adafruit ESP32 Feather V2";
17+
compatible = "adafruit,adafruit_feather_esp32_v2";
18+
19+
chosen {
20+
zephyr,sram = &sram1;
21+
zephyr,console = &uart0;
22+
zephyr,shell-uart = &uart0;
23+
zephyr,flash = &flash0;
24+
zephyr,code-partition = &slot0_partition;
25+
zephyr,bt-hci = &esp32_bt_hci;
26+
};
27+
28+
aliases {
29+
sw0 = &user_button_0;
30+
watchdog0 = &wdt0;
31+
i2c-0 = &i2c0;
32+
led-strip = &led_strip;
33+
};
34+
35+
leds {
36+
compatible = "gpio-leds";
37+
status = "okay";
38+
39+
led0: led_0 {
40+
label = "Red-LED";
41+
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
42+
};
43+
};
44+
45+
gpio_keys {
46+
compatible = "gpio-keys";
47+
48+
user_button_0: button_0 {
49+
label = "User button 0";
50+
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; // GPIO 38
51+
zephyr,code = <INPUT_KEY_0>;
52+
};
53+
};
54+
};
55+
56+
&uart0 {
57+
status = "okay";
58+
current-speed = <115200>;
59+
pinctrl-0 = <&uart0_default>;
60+
pinctrl-names = "default";
61+
};
62+
63+
&uart1 {
64+
status = "okay";
65+
current-speed = <115200>;
66+
pinctrl-0 = <&uart1_default>;
67+
pinctrl-names = "default";
68+
};
69+
70+
&gpio0 {
71+
status = "okay";
72+
73+
neopixel_power_enable {
74+
gpio-hog;
75+
gpios = <2 GPIO_ACTIVE_HIGH>;
76+
output-high;
77+
};
78+
};
79+
80+
&gpio1 {
81+
status = "okay";
82+
};
83+
84+
&i2c0 {
85+
status = "okay";
86+
clock-frequency = <I2C_BITRATE_FAST>;
87+
pinctrl-0 = <&i2c0_default>;
88+
pinctrl-names = "default";
89+
sda-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>;
90+
scl-gpios = <&gpio0 20 GPIO_OPEN_DRAIN>;
91+
92+
};
93+
94+
&timer0 {
95+
status = "okay";
96+
};
97+
98+
&timer1 {
99+
status = "okay";
100+
};
101+
102+
&timer2 {
103+
status = "okay";
104+
};
105+
106+
&timer3 {
107+
status = "okay";
108+
};
109+
110+
&trng0 {
111+
status = "okay";
112+
};
113+
114+
&spi2 {
115+
#address-cells = <1>;
116+
#size-cells = <0>;
117+
pinctrl-0 = <&spim2_default>;
118+
pinctrl-names = "default";
119+
};
120+
121+
/* used for SK6812 */
122+
&spi3 {
123+
#address-cells = <1>;
124+
#size-cells = <0>;
125+
status = "okay";
126+
line-idle-low;
127+
pinctrl-0 = <&spim3_ws2812_led>;
128+
pinctrl-names = "default";
129+
130+
led_strip: ws2812@0 {
131+
compatible = "worldsemi,ws2812-spi";
132+
reg = <0>;
133+
spi-max-frequency = <WS2812C_SPI_FREQ>;
134+
135+
chain-length = <1>;
136+
color-mapping = <LED_COLOR_ID_GREEN>,
137+
<LED_COLOR_ID_RED>,
138+
<LED_COLOR_ID_BLUE>;
139+
spi-one-frame = <WS2812C_ONE_FRAME>;
140+
spi-zero-frame = <WS2812C_ZERO_FRAME>;
141+
};
142+
};
143+
144+
&wdt0 {
145+
status = "okay";
146+
};
147+
148+
&esp32_bt_hci {
149+
status = "okay";
150+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
identifier: adafruit_feather_esp32_v2/esp32/procpu
2+
name: Adafruit ESP32 Feather V2
3+
type: mcu
4+
arch: xtensa
5+
toolchain:
6+
- zephyr
7+
supported:
8+
- gpio
9+
- i2c
10+
- spi
11+
- watchdog
12+
- uart
13+
- pinmux
14+
- nvs
15+
vendor: adafruit
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_GPIO=y
4+
CONFIG_CONSOLE=y
5+
CONFIG_SERIAL=y
6+
CONFIG_UART_CONSOLE=y
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*")
4+
set(OPENOCD OPENOCD-NOTFOUND)
5+
endif()
6+
find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH)
7+
8+
include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake)
9+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
10+
11+
# the default ESP32 baud rate is not supported
12+
board_runner_args(esp32 "--esp-baud-rate=1500000")

0 commit comments

Comments
 (0)