diff --git a/boards/adafruit/feather_esp32/Kconfig b/boards/adafruit/feather_esp32/Kconfig new file mode 100644 index 0000000000000..1efedd6b9e5fb --- /dev/null +++ b/boards/adafruit/feather_esp32/Kconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2025 Lena Voytek +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BOARD_ADAFRUIT_FEATHER_ESP32_ESP32_PROCPU + default 256 if BOARD_ADAFRUIT_FEATHER_ESP32_ESP32_APPCPU diff --git a/boards/adafruit/feather_esp32/Kconfig.adafruit_feather_esp32 b/boards/adafruit/feather_esp32/Kconfig.adafruit_feather_esp32 new file mode 100644 index 0000000000000..46b91f8babb89 --- /dev/null +++ b/boards/adafruit/feather_esp32/Kconfig.adafruit_feather_esp32 @@ -0,0 +1,9 @@ +# Adafruit Feather ESP32 board configuration + +# Copyright (c) 2025 Lena Voytek +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_FEATHER_ESP32 + select SOC_ESP32_PICO_V3_02 + select SOC_ESP32_PROCPU if BOARD_ADAFRUIT_FEATHER_ESP32_ESP32_PROCPU + select SOC_ESP32_APPCPU if BOARD_ADAFRUIT_FEATHER_ESP32_ESP32_APPCPU diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32-pinctrl.dtsi b/boards/adafruit/feather_esp32/adafruit_feather_esp32-pinctrl.dtsi new file mode 100644 index 0000000000000..1f5d5e9586840 --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32-pinctrl.dtsi @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2025 Lena Voytek + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart1_default: uart1_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + ; + }; + + group2 { + pinmux = ; + output-low; + }; + }; + + spim3_ws2812_led: spi3_ws2812_led { + group1 { + pinmux = ; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; +}; diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu.dts b/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu.dts new file mode 100644 index 0000000000000..3f01dbda27ab9 --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu.dts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include + +/ { + model = "Adafruit Feather ESP32 APPCPU"; + compatible = "espressif,esp32"; + + chosen { + zephyr,sram = &sram1; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_appcpu_partition; + }; +}; + +&ipm0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu.yaml b/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu.yaml new file mode 100644 index 0000000000000..423360ea7b16f --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu.yaml @@ -0,0 +1,27 @@ +identifier: adafruit_feather_esp32/esp32/appcpu +name: Adafruit Feather ESP32 APPCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp +vendor: adafruit diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu_defconfig b/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu_defconfig new file mode 100644 index 0000000000000..48546641cadd6 --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32_appcpu_defconfig @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu.dts b/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu.dts new file mode 100644 index 0000000000000..d3760f4530686 --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu.dts @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 Lena Voytek + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include "adafruit_feather_esp32-pinctrl.dtsi" +#include +#include +#include +#include + +/ { + model = "Adafruit Feather ESP32 PROCPU"; + compatible = "adafruit,adafruit_feather_esp32"; + + chosen { + zephyr,sram = &sram1; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + }; + + aliases { + sw0 = &user_button_0; + watchdog0 = &wdt0; + i2c-0 = &i2c0; + led-strip = &led_strip; + }; + + leds { + compatible = "gpio-leds"; + status = "okay"; + + led0: led_0 { + label = "Red-LED"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + user_button_0: button_0 { + label = "User button 0"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; // GPIO 38 + zephyr,code = ; + }; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; + + neopixel_power_enable { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + sda-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>; + scl-gpios = <&gpio0 20 GPIO_OPEN_DRAIN>; + +}; + +&timer0 { + status = "okay"; +}; + +&timer1 { + status = "okay"; +}; + +&timer2 { + status = "okay"; +}; + +&timer3 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +/* used for SK6812 */ +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + line-idle-low; + pinctrl-0 = <&spim3_ws2812_led>; + pinctrl-names = "default"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + reg = <0>; + spi-max-frequency = ; + + chain-length = <1>; + color-mapping = , + , + ; + spi-one-frame = ; + spi-zero-frame = ; + }; +}; + +&wdt0 { + status = "okay"; +}; + +&esp32_bt_hci { + status = "okay"; +}; + +&wifi { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu.yaml b/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu.yaml new file mode 100644 index 0000000000000..0c0c3fb0f1a0f --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu.yaml @@ -0,0 +1,23 @@ +identifier: adafruit_feather_esp32/esp32/procpu +name: Adafruit Feather ESP32 PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - i2c + - spi + - watchdog + - uart + - pinmux + - nvs + - counter + - entropy + - pwm + - dma + - input + - feather_serial + - feather_i2c + - feather_spi +vendor: adafruit diff --git a/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu_defconfig b/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu_defconfig new file mode 100644 index 0000000000000..bff67f69b1af0 --- /dev/null +++ b/boards/adafruit/feather_esp32/adafruit_feather_esp32_procpu_defconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_GPIO=y +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y diff --git a/boards/adafruit/feather_esp32/board.cmake b/boards/adafruit/feather_esp32/board.cmake new file mode 100644 index 0000000000000..91b3caa2c75d5 --- /dev/null +++ b/boards/adafruit/feather_esp32/board.cmake @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) + +# the default ESP32 baud rate is not supported +board_runner_args(esp32 "--esp-baud-rate=1500000") diff --git a/boards/adafruit/feather_esp32/board.yml b/boards/adafruit/feather_esp32/board.yml new file mode 100644 index 0000000000000..24824fe1d8593 --- /dev/null +++ b/boards/adafruit/feather_esp32/board.yml @@ -0,0 +1,11 @@ +board: + name: adafruit_feather_esp32 + full_name: Adafruit Feather ESP32 + vendor: adafruit + socs: + - name: esp32 + revision: + format: number + default: "2" + revisions: + - name: "2" diff --git a/boards/adafruit/feather_esp32/doc/img/adafruit_feather_esp32.webp b/boards/adafruit/feather_esp32/doc/img/adafruit_feather_esp32.webp new file mode 100644 index 0000000000000..9f50d39efd11d Binary files /dev/null and b/boards/adafruit/feather_esp32/doc/img/adafruit_feather_esp32.webp differ diff --git a/boards/adafruit/feather_esp32/doc/index.rst b/boards/adafruit/feather_esp32/doc/index.rst new file mode 100644 index 0000000000000..9c6141ae0d7e9 --- /dev/null +++ b/boards/adafruit/feather_esp32/doc/index.rst @@ -0,0 +1,113 @@ +.. zephyr:board:: adafruit_feather_esp32 + +Overview +******** + +The Adafruit ESP32 Feather is an ESP32-based development board using the +Feather standard layout. + +It features the following integrated components: + +- ESP32-PICO-V3-02 chip (240MHz dual core, Wi-Fi + BLE) +- 520KB SRAM +- USB-C port connected to USB to Serial converter +- LiPo battery connector and charger +- Charging indicator LED and user LED +- NeoPixel RGB LED +- Reset and user buttons +- STEMMA QT I2C connector + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +System requirements +=================== + +Prerequisites +------------- + +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run +the commands below to retrieve the files. + +.. code-block:: shell + + west update + west blobs fetch hal_espressif + +Building & flashing +------------------- + +Use the standard build and flash process for this board. See +:ref:`build_an_application` and :ref:`application_run` for more details. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32/esp32/procpu + :goals: build flash + +The baud rate of 921600bps is set by default. If experiencing issues when flashing, +try using different values by using ``--esp-baud-rate `` option during +``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). + +After flashing, view the serial monitor with the espressif monitor command. + +.. code-block:: shell + + west espressif monitor + +Testing +======= + +On-board LED +------------ + +Test the functionality of the user LED connected to pin 13 with the blinky +sample program. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: adafruit_feather_esp32/esp32/procpu + :goals: build flash + +NeoPixel +-------- + +Test the on-board NeoPixel using the led_strip sample program. + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/led/led_strip + :board: adafruit_feather_esp32/esp32/procpu + :goals: build flash + +User button +----------- + +Test the button labeled SW38 using the button input sample program. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/button + :board: adafruit_feather_esp32/esp32/procpu + :goals: build flash + +Wi-Fi +----- + +Test ESP32 Wi-Fi functionality using the Wi-Fi shell module. + +.. note:: + The hal_espressif blobs must be fetched first. + +.. zephyr-app-commands:: + :zephyr-app: samples/net/wifi/shell + :board: adafruit_feather_esp32/esp32/procpu + :goals: build flash + +References +********** +- `Adafruit ESP32 Feather V2 `_ +- `Adafruit ESP32 Feather V2 Pinouts `_ +- `Adafruit ESP32 Feather V2 Schematic `_ +- `ESP32-PICO-MINI-02 Datasheet `_ (PDF) +- `STEMMA QT `_ diff --git a/samples/drivers/led/led_strip/boards/adafruit_feather_esp32_procpu.conf b/samples/drivers/led/led_strip/boards/adafruit_feather_esp32_procpu.conf new file mode 100644 index 0000000000000..8230eb9896b4f --- /dev/null +++ b/samples/drivers/led/led_strip/boards/adafruit_feather_esp32_procpu.conf @@ -0,0 +1,2 @@ +CONFIG_GPIO=y +CONFIG_GPIO_HOGS=y