Skip to content

Commit

Permalink
boards: Adding Adafruit QT Py ESP32s3 support.
Browse files Browse the repository at this point in the history
This adds support for the ESP32s3 based Adafruit QT Py, as well as its
PSRAM variant.

Signed-off-by: Ian Wakely <[email protected]>
  • Loading branch information
raveious committed Dec 8, 2024
1 parent bea5fc7 commit 64ea32e
Show file tree
Hide file tree
Showing 21 changed files with 794 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boards/adafruit/qt_py_esp32s3/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Ian Wakely

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096 if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_PROCPU
default 256 if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_APPCPU
9 changes: 9 additions & 0 deletions boards/adafruit/qt_py_esp32s3/Kconfig.adafruit_qt_py_esp32s3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Adafruit ESP32S3 board configuration

# Copyright (c) 2024 Ian Wakely

config BOARD_ADAFRUIT_QT_PY_ESP32S3
select SOC_ESP32S3_WROOM_N8 if "$(BOARD_REVISION)" = ""
select SOC_ESP32S3_WROOM_N4R2 if "$(BOARD_REVISION)" = "psram"
select SOC_ESP32S3_PROCPU if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_PROCPU
select SOC_ESP32S3_APPCPU if BOARD_ADAFRUIT_QT_PY_ESP32S3_ESP32S3_APPCPU
10 changes: 10 additions & 0 deletions boards/adafruit/qt_py_esp32s3/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

choice BOOTLOADER
default BOOTLOADER_MCUBOOT
endchoice

choice BOOT_SIGNATURE_TYPE
default BOOT_SIGNATURE_TYPE_NONE
endchoice
67 changes: 67 additions & 0 deletions boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2022 Google LLC
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <dt-bindings/pinctrl/esp32s3-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h>

&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO5>;
output-high;
};
group2 {
pinmux = <UART0_RX_GPIO16>;
bias-pull-up;
};
};

spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO37>,
<SPIM2_SCLK_GPIO36>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO35>;
output-low;
};
};

spim3_ws2812_led: spim3_ws2812_led {
group1 {
pinmux = <SPIM3_MOSI_GPIO39>;
output-low;
};
};

i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO7>,
<I2C0_SCL_GPIO6>;
bias-pull-up;
drive-open-drain;
output-high;
};
};

i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SDA_GPIO41>,
<I2C1_SCL_GPIO40>;
bias-pull-up;
drive-open-drain;
output-high;
};
};

twai_default: twai_default {
group1 {
pinmux = <TWAI_TX_GPIO9>,
<TWAI_RX_GPIO8>;
};
};
};
30 changes: 30 additions & 0 deletions boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2024 Ian Wakely
*/

/dts-v1/;

#include <espressif/esp32s3/esp32s3_wroom_n8.dtsi>
#include "adafruit_qt_py_esp32s3-pinctrl.dtsi"
#include <espressif/partitions_0x0_amp.dtsi>

/ {
model = "Adafruit QT Py ESP32S3 APPCPU";
compatible = "espressif,esp32s3";

chosen {
zephyr,sram = &sram1;
zephyr,ipc_shm = &shm0;
zephyr,ipc = &ipm0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_appcpu_partition;
};
};

&trng0 {
status = "okay";
};

&ipm0 {
status = "okay";
};
27 changes: 27 additions & 0 deletions boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
identifier: adafruit_qt_py_esp32s3/esp32s3/appcpu
name: Adafruit QT Py ESP32S3 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_MAIN_STACK_SIZE=2048
CONFIG_CLOCK_CONTROL=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2024 Ian Wakely
*/

/delete-node/ &flash0;

/ {
model = "Adafruit QT Py ESP32S3 PSRAM APPCPU";

soc {
flash: flash-controller@60002000 {
compatible = "espressif,esp32-flash-controller";
reg = <0x60002000 0x1000>;
#address-cells = <1>;
#size-cells = <1>;

/* 4MB flash */
flash0: flash@0 {
compatible = "soc-nv-flash";
erase-block-size = <4096>;
write-block-size = <4>;
reg = <0x0 DT_SIZE_M(4)>;
};
};
};
};

/* 2MB psram */
&psram0 {
reg = <0x3c000000 DT_SIZE_M(2)>;
status = "okay";
};

#include <espressif/partitions_0x0_amp.dtsi>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
identifier: adafruit_qt_py_esp32s3@psram/esp32s3/appcpu
name: Adafruit QT Py ESP32S3 PSRAM 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
149 changes: 149 additions & 0 deletions boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*
* Copyright (c) 2023 Seeed Studio inc.
* Copyright (c) 2024 Ian Wakely
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <espressif/esp32s3/esp32s3_wroom_n8.dtsi>
#include <zephyr/dt-bindings/led/led.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "adafruit_qt_py_esp32s3-pinctrl.dtsi"
#include "seeed_xiao_connector.dtsi"
#include <espressif/partitions_0x0_amp.dtsi>

/ {
model = "Adafruit QT Py ESP32S3 PROCPU";
compatible = "seeed,xiao-esp32s3";

chosen {
zephyr,sram = &sram1;
zephyr,console = &usb_serial;
zephyr,shell-uart = &usb_serial;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci = &esp32_bt_hci;
};

aliases {
i2c-0 = &i2c0;
watchdog0 = &wdt0;
led-strip = &led_strip;
sw0 = &button0;
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "User button";
zephyr,code = <INPUT_KEY_0>;
};
};
};

&usb_serial {
status = "okay";
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};

&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};

&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c1_default>;
pinctrl-names = "default";
};

&trng0 {
status = "okay";
};

&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
};

&spi3 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim3_ws2812_led>;
pinctrl-names = "default";

line-idle-low;

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <6400000>;

/* WS2812 */
chain-length = <1>;
spi-cpha;
spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */
spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";

/*
* Unlike some of the other Adafruit boards, the neopixel on this board has
* its positive side hooked up to a GPIO pin rather than a positive voltage
* rail to save on power. This will enable the LED on board initialization.
*/
neopixel-power-enable {
gpio-hog;
gpios = <6 GPIO_ACTIVE_HIGH>;
output-high;
};
};

&wdt0 {
status = "okay";
};

&twai {
pinctrl-0 = <&twai_default>;
pinctrl-names = "default";
};

&timer0 {
status = "okay";
};

&timer1 {
status = "okay";
};

&esp32_bt_hci {
status = "okay";
};
19 changes: 19 additions & 0 deletions boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
identifier: adafruit_qt_py_esp32s3/esp32s3/procpu
name: Adafruit QT Py ESP32S3 PROCPU
type: mcu
arch: xtensa
toolchain:
- zephyr
supported:
- gpio
- uart
- i2c
- i2s
- spi
- can
- counter
- watchdog
- entropy
- pwm
- dma
vendor: adafruit
Loading

0 comments on commit 64ea32e

Please sign in to comment.