boards: xtensa: Add support for YD-ESP32 board

Add `yd_esp32` board:

- Model name: YD-ESP32
- Manufacturer: VCC-GND® Studio
- Espressif module: ESP32-WROOM-32E

Signed-off-by: Julio Cesar <hi@jcsx.dev>
This commit is contained in:
Julio Cesar 2023-07-05 02:09:38 -03:00 committed by Fabio Baltieri
commit 5e15e8cb48
33 changed files with 1008 additions and 2 deletions

View file

@ -0,0 +1,12 @@
# YD-ESP32 board configuration
# Copyright (c) 2023 Julio Cesar <hi@jcsx.dev>
# SPDX-License-Identifier: Apache-2.0
config BOARD_YD_ESP32
bool "YD-ESP32 Development Board"
depends on SOC_SERIES_ESP32
choice SOC_PART_NUMBER
default SOC_ESP32_WROOM_32UE_N4
endchoice

View file

@ -0,0 +1,20 @@
# YD-ESP32 board configuration
# Copyright (c) 2023 Julio Cesar <hi@jcsx.dev>
# SPDX-License-Identifier: Apache-2.0
config BOARD
default "yd_esp32"
depends on BOARD_YD_ESP32
config ENTROPY_GENERATOR
default y
config HEAP_MEM_POOL_SIZE
default 98304 if WIFI
default 40960 if BT
default 4096
choice BT_HCI_BUS_TYPE
default BT_ESP32 if BT
endchoice

View file

@ -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

View file

@ -0,0 +1,9 @@
# 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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -0,0 +1,310 @@
.. _yd_esp32:
YD-ESP32
########
Overview
********
The YD-ESP32 development board is one of VCC-GND® Studios official boards.
This board is based on the ESP32-WROOM-32E module, with the ESP32 as the core.
.. figure:: img/yd_esp32.png
:align: center
:alt: YD-ESP32
YD-ESP32 DevKit with ESP32-WROOM-32E Module
ESP32
=====
ESP32 is a series of low cost, low power system on a chip microcontrollers
with integrated Wi-Fi & dual-mode Bluetooth. The ESP32 series employs a
Tensilica Xtensa LX6 microprocessor in both dual-core and single-core
variations. ESP32 is created and developed by Espressif Systems, a
Shanghai-based Chinese company, and is manufactured by TSMC using their 40nm
process. [1]_
The features include the following:
- Dual core Xtensa microprocessor (LX6), running at 160 or 240MHz
- 520KB of SRAM
- 802.11b/g/n/e/i
- Bluetooth v4.2 BR/EDR and BLE
- Various peripherals:
- 12-bit ADC with up to 18 channels
- 2x 8-bit DACs
- 10x touch sensors
- Temperature sensor
- 4x SPI
- 2x I2S
- 2x I2C
- 3x UART
- SD/SDIO/MMC host
- Slave (SDIO/SPI)
- Ethernet MAC
- CAN bus 2.0
- IR (RX/TX)
- Motor PWM
- LED PWM with up to 16 channels
- Hall effect sensor
- Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES)
- 5uA deep sleep current
Supported Features
==================
Current Zephyr's YD-ESP32 board supports the following features:
+------------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+============+============+=====================================+
+------------+------------+-------------------------------------+
| UART | on-chip | serial port |
+------------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+------------+------------+-------------------------------------+
| PINMUX | on-chip | pinmux |
+------------+------------+-------------------------------------+
| USB-JTAG | on-chip | hardware interface |
+------------+------------+-------------------------------------+
| SPI Master | on-chip | spi |
+------------+------------+-------------------------------------+
| Timers | on-chip | counter |
+------------+------------+-------------------------------------+
| Watchdog | on-chip | watchdog |
+------------+------------+-------------------------------------+
| TRNG | on-chip | entropy |
+------------+------------+-------------------------------------+
| LEDC | on-chip | pwm |
+------------+------------+-------------------------------------+
| MCPWM | on-chip | pwm |
+------------+------------+-------------------------------------+
| PCNT | on-chip | qdec |
+------------+------------+-------------------------------------+
| SPI DMA | on-chip | spi |
+------------+------------+-------------------------------------+
| TWAI | on-chip | can |
+------------+------------+-------------------------------------+
| ADC | on-chip | adc |
+------------+------------+-------------------------------------+
| DAC | on-chip | dac |
+------------+------------+-------------------------------------+
| Wi-Fi | on-chip | |
+------------+------------+-------------------------------------+
| Bluetooth | on-chip | |
+------------+------------+-------------------------------------+
System requirements
===================
Prerequisites
-------------
Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command
below to retrieve those files.
.. code-block:: console
west blobs fetch hal_espressif
.. note::
It is recommended running the command above after :file:`west update`.
Building & Flashing
*******************
ESP-IDF bootloader
==================
The board is using the ESP-IDF bootloader as the default 2nd stage bootloader.
It is build as a subproject at each application build. No further attention
is expected from the user.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be build (and flash) at least once.
There are two options to be used when building an application:
1. Sysbuild
2. Manual build
.. note::
User can select the MCUboot bootloader by adding the following line
to the board default configuration file.
```
CONFIG_BOOTLOADER_MCUBOOT=y
```
Sysbuild
========
The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the EPS32 SoC.
To build the sample application using sysbuild use the command:
.. zephyr-app-commands::
:tool: west
:app: samples/hello_world
:board: yd_esp32
:goals: build
:west-args: --sysbuild
:compact:
By default, the ESP32 sysbuild creates bootloader (MCUboot) and application
images. But it can be configured to create other kind of images.
Build directory structure created by sysbuild is different from traditional
Zephyr build. Output is structured by the domain subdirectories:
.. code-block::
build/
├── hello_world
│   └── zephyr
│   ├── zephyr.elf
│   └── zephyr.bin
├── mcuboot
│ └── zephyr
│ ├── zephyr.elf
│ └── zephyr.bin
└── domains.yaml
.. note::
With ``--sysbuild`` option the bootloader will be re-build and re-flash
every time the pristine build is used.
For more information about the system build please read the :ref:`sysbuild` documentation.
Manual build
============
During the development cycle, it is intended to build & flash as quickly possible.
For that reason, images can be build one at a time using traditional build.
The instructions following are relevant for both manual build and sysbuild.
The only difference is the structure of the build directory.
.. note::
Remember that bootloader (MCUboot) needs to be flash at least once.
Build and flash applications as usual (see :ref:`build_an_application` and
:ref:`application_run` for more details).
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: yd_esp32
:goals: build
The usual ``flash`` target will work with the ``yd_esp32`` board
configuration. Here is an example for the :ref:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: yd_esp32
:goals: flash
Open the serial monitor using the following command:
.. code-block:: shell
west espressif monitor
After the board has automatically reset and booted, you should see the following
message in the monitor:
.. code-block:: console
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
Hello World! yd_esp32
RGB LED
=======
The board contains an addressable RGB LED (`XL-5050RGBC-WS2812B`_), driven by GPIO16.
Here is an example of how to test it using the :ref:`led_ws2812_sample` application.
.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_ws2812
:board: yd_esp32
:goals: flash
.. _`XL-5050RGBC-WS2812B`: http://www.xinglight.cn/index.php?c=show&id=947
Debugging
*********
ESP32 support on OpenOCD is available upstream as of version 0.12.0.
Download and install OpenOCD from `OpenOCD`_.
On the YD-ESP32 board, the JTAG pins are not run to a
standard connector (e.g. ARM 20-pin) and need to be manually connected
to the external programmer (e.g. a Flyswatter2):
+------------+-----------+
| ESP32 pin | JTAG pin |
+============+===========+
| 3V3 | VTRef |
+------------+-----------+
| EN | nTRST |
+------------+-----------+
| IO14 | TMS |
+------------+-----------+
| IO12 | TDI |
+------------+-----------+
| GND | GND |
+------------+-----------+
| IO13 | TCK |
+------------+-----------+
| IO15 | TDO |
+------------+-----------+
Further documentation can be obtained from the SoC vendor in `JTAG debugging
for ESP32`_.
Here is an example for building the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: yd_esp32
:goals: build flash
You can debug an application in the usual way. Here is an example for the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: yd_esp32
:goals: debug
Note on Debugging with GDB Stub
===============================
GDB stub is enabled on ESP32.
* When adding breakpoints, please use hardware breakpoints with command
``hbreak``. Command ``break`` uses software breakpoints which requires
modifying memory content to insert break/trap instructions.
This does not work as the code is on flash which cannot be randomly
accessed for modification.
.. _`JTAG debugging for ESP32`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/index.html
.. _`OpenOCD`: https://github.com/openocd-org/openocd
References
**********
.. [1] https://en.wikipedia.org/wiki/ESP32
.. _ESP32 Technical Reference Manual: https://espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
.. _Hardware Reference: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/index.html

View file

@ -0,0 +1,5 @@
set ESP_RTOS none
set ESP32_ONLYCPU 1
source [find interface/ftdi/esp32_devkitj_v1.cfg]
source [find target/esp32.cfg]

View file

@ -0,0 +1,77 @@
/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <dt-bindings/pinctrl/esp32-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32-gpio-sigmap.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO1>;
output-high;
};
group2 {
pinmux = <UART0_RX_GPIO3>;
bias-pull-up;
};
};
uart1_default: uart1_default {
group1 {
pinmux = <UART1_TX_GPIO10>;
};
group2 {
pinmux = <UART1_RX_GPIO9>;
bias-pull-up;
};
};
uart2_default: uart2_default {
group1 {
pinmux = <UART2_TX_GPIO17>;
};
group2 {
pinmux = <UART2_RX_GPIO16>;
bias-pull-up;
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO12>,
<SPIM2_SCLK_GPIO14>,
<SPIM2_CSEL_GPIO15>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO13>;
output-low;
};
};
spim3_default: spim3_default {
group1 {
pinmux = <SPIM3_MISO_GPIO19>,
<SPIM3_SCLK_GPIO18>,
<SPIM3_CSEL_GPIO5>;
};
group2 {
pinmux = <SPIM3_MOSI_GPIO23>;
output-low;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO21>,
<I2C0_SCL_GPIO22>;
bias-pull-up;
drive-open-drain;
output-high;
};
};
};

View file

@ -0,0 +1,183 @@
/*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32/esp32_wroom_32ue_n16.dtsi>
#include <zephyr/dt-bindings/led/led.h>
#include "yd_esp32-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "VCC-GND Studio YD-ESP32";
compatible = "espressif,esp32";
aliases {
uart-0 = &uart0;
i2c-0 = &i2c0;
sw0 = &button0;
watchdog0 = &wdt0;
led-strip = &rgb_led;
};
buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "BOOT Button";
zephyr,code = <INPUT_KEY_0>;
};
};
chosen {
zephyr,sram = &sram0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,flash = &flash0;
};
};
&pinctrl {
spim2_default: spim2_default {
group2 {
pinmux = <SPIM2_MOSI_GPIO16>;
output-low;
};
};
};
&cpu0 {
clock-frequency = <ESP32_CLK_CPU_240M>;
cpu-power-states = <&light_sleep &deep_sleep>;
};
&cpu1 {
clock-frequency = <ESP32_CLK_CPU_240M>;
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};
&uart1 {
current-speed = <115200>;
pinctrl-0 = <&uart1_default>;
pinctrl-names = "default";
};
&uart2 {
current-speed = <115200>;
pinctrl-0 = <&uart2_default>;
pinctrl-names = "default";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
sda-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>;
scl-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};
&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
rgb_led: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <6400000>;
/* XL-5050RGBC-WS2812B */
chain-length = <1>;
spi-one-frame = <0xfc>; /* 11111100: 0.937 us high and 0.313 us low */
spi-zero-frame = <0xc0>; /* 11000000: 0.313 us high and 0.937 us low */
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
};
};
&spi3 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim3_default>;
pinctrl-names = "default";
};
&timer0 {
status = "disabled";
};
&timer1 {
status = "disabled";
};
&timer2 {
status = "disabled";
};
&timer3 {
status = "disabled";
};
&trng0 {
status = "okay";
};
&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Reserve 60kB for the bootloader */
boot_partition: partition@1000 {
label = "mcuboot";
reg = <0x00001000 0x0000F000>;
read-only;
};
/* Reserve 1024kB for the application in slot 0 */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00100000>;
};
/* Reserve 1024kB for the application in slot 1 */
slot1_partition: partition@110000 {
label = "image-1";
reg = <0x00110000 0x00100000>;
};
/* Reserve 256kB for the scratch partition */
scratch_partition: partition@210000 {
label = "image-scratch";
reg = <0x00210000 0x00040000>;
};
storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00006000>;
};
};
};

View file

@ -0,0 +1,23 @@
identifier: yd_esp32
name: YD-ESP32
type: mcu
arch: xtensa
toolchain:
- zephyr
supported:
- adc
- dac
- gpio
- i2c
- watchdog
- uart
- nvs
- pwm
- dac
- spi
- counter
- entropy
testing:
ignore_tags:
- net
- bluetooth

View file

@ -0,0 +1,13 @@
# Copyright (c) 2023 Julio Cesar <hi@jcsx.dev>
# SPDX-License-Identifier: Apache-2.0
CONFIG_BOARD_YD_ESP32=y
CONFIG_SOC_SERIES_ESP32=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y

View file

@ -0,0 +1,4 @@
CONFIG_CONSOLE=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_BT_MAX_CONN=9

View file

@ -0,0 +1,34 @@
/*
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
chosen {
zephyr,bt-c2h-uart = &uart1;
};
};
&pinctrl {
uart1_default: uart1_default {
group1 {
pinmux = <UART1_TX_GPIO5>,
<UART1_RX_GPIO18>,
<UART1_RTS_GPIO19>;
};
group2 {
pinmux = <UART1_CTS_GPIO23>;
bias-pull-up;
};
};
};
&uart1 {
status = "okay";
current-speed = <921600>;
pinctrl-0 = <&uart1_default>;
pinctrl-names = "default";
};

View file

@ -0,0 +1,2 @@
# Enables GPIO2 and GPIO4 as wakeup sources
CONFIG_EXAMPLE_EXT1_WAKEUP=y

View file

@ -0,0 +1,9 @@
/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
&flash0 {
write-block-size = <32>;
};

View file

@ -3,5 +3,7 @@ sample:
name: flash_encryption
tests:
sample.board.esp32:
platform_allow: esp32_devkitc_wroom
platform_allow:
- esp32_devkitc_wroom
- yd_esp32
tags: esp32

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2022 Wolter HV <wolterhv@gmx.de>
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
zephyr,user {
io-channels =
<&adc0 0>,
<&adc1 0>;
};
};
&adc0 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1_4";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};
&adc1 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1_4";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};

View file

@ -0,0 +1,3 @@
&timer0 {
status = "okay";
};

View file

@ -0,0 +1,17 @@
/*
* Copyright 2022 Espressif (Shanghai)
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
zephyr,user {
dac = <&dac>;
dac-channel-id = <0>;
dac-resolution = <8>;
};
};
&dac {
status = "okay";
};

View file

@ -0,0 +1,3 @@
&ipm0 {
status = "okay";
};

View file

@ -0,0 +1,12 @@
CONFIG_WIFI=y
CONFIG_HEAP_MEM_POOL_SIZE=98304
CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=y
CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y
CONFIG_NET_LOG=y

View file

@ -0,0 +1,9 @@
/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
&wifi {
status = "okay";
};

View file

@ -0,0 +1,28 @@
&pinctrl {
uart2_default: uart2_default {
group1 {
pinmux = <UART2_TX_GPIO32>;
};
group2 {
pinmux = <UART2_RX_GPIO33>;
bias-pull-up;
};
};
};
&uart2 {
status = "okay";
current-speed = <57600>;
pinctrl-0 = <&uart2_default>;
pinctrl-names = "default";
fps {
#address-cells=<1>;
#size-cells=<0>;
grow_r502a@ffffffff {
compatible = "hzgrow,r502a";
reg = <0xffffffff>;
int-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
};
};
};

View file

@ -0,0 +1,4 @@
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

View file

@ -0,0 +1,35 @@
/*
* Copyright (c) 2022 Wolter HV <wolterhv@gmx.de>
* Copyright (c) 2023 Benjamin Björnsson <benjamin.bjornsson@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&adc0 0>, <&adc0 1>;
};
};
&adc0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
channel@1 {
reg = <1>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};

View file

@ -0,0 +1,3 @@
&timer0 {
status = "okay";
};

View file

@ -0,0 +1,9 @@
/*
* Copyright 2022 Espressif (Shanghai)
*
* SPDX-License-Identifier: Apache-2.0
*/
&dac {
status = "okay";
};

View file

@ -70,7 +70,8 @@
defined(CONFIG_BOARD_GD32E103V_EVAL) || \
defined(CONFIG_BOARD_GD32F450I_EVAL) || \
defined(CONFIG_BOARD_GD32F450Z_EVAL) || \
defined(CONFIG_BOARD_GD32F470I_EVAL)
defined(CONFIG_BOARD_GD32F470I_EVAL) || \
defined(CONFIG_BOARD_YD_ESP32)
#define DAC_DEVICE_NODE DT_NODELABEL(dac)
#define DAC_RESOLUTION 12

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2019 Mohamed ElShahawi
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
resources {
compatible = "test-gpio-basic-api";
out-gpios = <&gpio0 16 0>;
in-gpios = <&gpio0 17 0>;
};
};
/*
* Some notes about esp32 pins:
* GPIO pins 34-39 are not suitable for this test because:
* 1. input-only
* 2. No internal pull-up/pull-down circuitry.
* The pin names are: SENSOR_VP(GPIO36),SENSOR_CAPP(GPIO37),
* SENSOR_CAPN (GPIO38), SENSOR_VN (GPIO39),
* VDET_1 (GPIO34), VDET_2 (GPIO35).
*/

View file

@ -0,0 +1,37 @@
/*
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <dt-bindings/pinctrl/esp32-pinctrl.h>
/ {
pwm_loopback_0 {
compatible = "test-pwm-loopback";
/* first index must be a 32-Bit timer */
pwms = <&mcpwm0 0 0 PWM_POLARITY_NORMAL>,
<&mcpwm0 6 0 PWM_POLARITY_NORMAL>;
};
};
&pinctrl {
mcpwm0_default: mcpwm0_default {
group1 {
pinmux = <MCPWM0_OUT0A_GPIO2>;
output-enable;
};
group2 {
pinmux = <MCPWM0_CAP0_GPIO4>;
};
};
};
&mcpwm0 {
pinctrl-0 = <&mcpwm0_default>;
pinctrl-names = "default";
prescale = <255>;
prescale-timer0 = <103>;
status = "okay";
};

View file

@ -0,0 +1 @@
CONFIG_SPI_ESP32_INTERRUPT=y

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2022 Kumar Gala <galak@kernel.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
spim3_loopback: spim3_loopback {
group1 {
pinmux = <SPIM3_MISO_GPIO19>;
output-enable; /* Enable internal loopback */
};
group2 {
pinmux = <SPIM3_MOSI_GPIO19>;
input-enable; /* Enable internal loopback */
};
group3 {
pinmux = <SPIM3_SCLK_GPIO18>,
<SPIM3_CSEL_GPIO5>;
};
};
};
&spi3 {
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <500000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <16000000>;
};
};
&spi3 {
dma-enabled;
pinctrl-0 = <&spim3_default>;
};

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
&flash0 {
partitions {
/*
* Reduce storage_partition to make space for
* coredump_partition
*/
storage_partition: partition@250000 {
label = "storage";
reg = <0x00250000 0x00005000>;
};
coredump_partition: partition@255000 {
label = "coredump-partition";
reg = <0x255000 DT_SIZE_K(4)>;
};
};
};