Initial commit with basic project structure and Firebeetle 2 board definition

This commit is contained in:
Eduard Iten 2025-06-29 12:13:32 +02:00
parent 6b86f5edf4
commit a55c5601c0
205 changed files with 8183 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

8
CMakeLists.txt Normal file
View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.20)
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(firebeatle)
target_sources(app PRIVATE src/main.c)

1
README.de.md Normal file
View File

@ -0,0 +1 @@
# firebeatle

1
README.md Normal file
View File

@ -0,0 +1 @@
# firebeatle

View File

@ -4,3 +4,49 @@ board:
vendor: dfrobot vendor: dfrobot
socs: socs:
- name: esp32c6 - name: esp32c6
variants:
- name: firebeetle2_esp32c6_hpcore
board_name: firebeetle2_esp32c6_hpcore
meta:
name: FireBeetle 2 ESP32-C6 (HP-Core)
type: mcu
arch: riscv
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- uart
- gpio
- i2c
- spi
- wifi
- ble
ram: 512
flash: 4096
testing:
ignore_tags:
- net
- bluetooth
- name: firebeetle2_esp32c6_lpcore
board_name: firebeetle2_esp32c6_lpcore
meta:
name: FireBeetle 2 ESP32-C6 (LP-Core)
type: mcu
arch: riscv
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- uart
- gpio
- i2c
- spi
ram: 16
flash: 0
testing:
ignore_tags:
- net
- bluetooth
default_variant: firebeetle2_esp32c6_hpcore

View File

@ -0,0 +1,7 @@
# Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096 if BOARD_ESP32_DEVKITC_ESP32_PROCPU
default 256 if BOARD_ESP32_DEVKITC_ESP32_APPCPU

View File

@ -0,0 +1,7 @@
# Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32_DEVKITC
select SOC_ESP32_WROVER_E_N4R8
select SOC_ESP32_PROCPU if BOARD_ESP32_DEVKITC_ESP32_PROCPU
select SOC_ESP32_APPCPU if BOARD_ESP32_DEVKITC_ESP32_APPCPU

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,11 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# 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)

View File

@ -0,0 +1,6 @@
board:
name: esp32_devkitc
full_name: ESP32-DevKitC
vendor: espressif
socs:
- name: esp32

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,256 @@
.. zephyr:board:: esp32_devkitc
Overview
********
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. For more information, check `ESP32-DevKitC`_.
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
For more information, check the datasheet at `ESP32 Datasheet`_ or the technical reference
manual at `ESP32 Technical Reference Manual`_.
Asymmetric Multiprocessing (AMP)
********************************
ESP32-DevKitC-WROVER allows 2 different applications to be executed in ESP32 SoC. Due to its dual-core architecture, each core can be enabled to execute customized tasks in stand-alone mode
and/or exchanging data over OpenAMP framework. See :zephyr:code-sample-category:`ipc` folder as code reference.
Supported Features
==================
.. zephyr:board-supported-hw::
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
*******************
.. zephyr:board-supported-runners::
Simple boot
===========
The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.
.. note::
Simple boot does not provide any security features nor OTA updates.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be built (and flashed) 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.
.. code:: cfg
CONFIG_BOOTLOADER_MCUBOOT=y
Sysbuild
========
The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the ESP32 SoC.
To build the sample application using sysbuild use the command:
.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/hello_world
:board: esp32_devkitc
: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 built 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: esp32_devkitc/esp32/procpu
:goals: build
The usual ``flash`` target will work with the ``esp32_devkitc`` board
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_devkitc/esp32/procpu
: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! esp32_devkitc
Debugging
*********
ESP32 support on OpenOCD is available at `OpenOCD ESP32`_.
On the ESP32-DevKitC 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 :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_devkitc/esp32/procpu
:goals: build flash
You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_devkitc/esp32/procpu
: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.
References
**********
.. target-notes::
.. _`ESP32-DevKitC`: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32/esp32-devkitc/index.html
.. _`ESP32 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
.. _`ESP32 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
.. _`JTAG debugging for ESP32`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/index.html
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

View File

@ -0,0 +1,107 @@
/*
* Copyright (c) 2022-2025 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;
};
};
i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};
i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_O_WS_GPIO8>,
<I2S1_O_BCK_GPIO3>,
<I2S1_O_SD_GPIO9>,
<I2S1_I_WS_GPIO10>,
<I2S1_I_BCK_GPIO11>;
output-enable;
};
group2 {
pinmux = <I2S1_I_SD_GPIO12>;
input-enable;
};
};
};

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32/esp32_appcpu.dtsi>
#include <espressif/partitions_0x1000_amp.dtsi>
/ {
model = "Espressif ESP32-DevkitC 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";
};

View File

@ -0,0 +1,27 @@
identifier: esp32_devkitc/esp32/appcpu
name: ESP32-DevkitC 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: espressif

View File

@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CLOCK_CONTROL=y

View File

@ -0,0 +1,146 @@
/*
* Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32/esp32_wrover_e_n4r8.dtsi>
#include "esp32_devkitc-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
#include <espressif/partitions_0x1000_amp.dtsi>
/ {
model = "Espressif ESP32-DevkitC PROCPU";
compatible = "espressif,esp32";
aliases {
uart-0 = &uart0;
i2c-0 = &i2c0;
sw0 = &button0;
watchdog0 = &wdt0;
};
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 = &sram1;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci = &esp32_bt_hci;
};
};
&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";
};
&touch {
debounce-interval-ms = <30>;
href-microvolt = <2700000>;
lref-microvolt = <500000>;
href-atten-microvolt = <1000000>;
filter-mode = <ESP32_TOUCH_FILTER_MODE_IIR_16>;
filter-debounce-cnt = <1>;
filter-noise-thr = <ESP32_TOUCH_FILTER_NOISE_THR_4_8TH>;
filter-jitter-step = <4>;
filter-smooth-level = <ESP32_TOUCH_FILTER_SMOOTH_MODE_IIR_2>;
};
&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";
};
&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};
&i2s1 {
pinctrl-0 = <&i2s1_default>;
pinctrl-names = "default";
status = "disabled";
};
&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_default>;
pinctrl-names = "default";
};
&timer0 {
status = "disabled";
};
&timer1 {
status = "disabled";
};
&timer2 {
status = "disabled";
};
&timer3 {
status = "disabled";
};
&trng0 {
status = "okay";
};
&esp32_bt_hci {
status = "okay";
};
&wifi {
status = "okay";
};

View File

@ -0,0 +1,22 @@
identifier: esp32_devkitc/esp32/procpu
name: ESP32-DevkitC PROCPU
type: mcu
arch: xtensa
toolchain:
- zephyr
supported:
- adc
- dac
- gpio
- i2c
- i2s
- watchdog
- uart
- nvs
- pwm
- dac
- spi
- counter
- entropy
- input
vendor: espressif

View File

@ -0,0 +1,8 @@
# Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y

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,6 @@
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_GPIO_ESP32)
zephyr_library()
zephyr_library_sources(board_init.c)
endif()

View File

@ -0,0 +1,7 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096 if BOARD_ESP32_ETHERNET_KIT_ESP32_PROCPU
default 256 if BOARD_ESP32_ETHERNET_KIT_ESP32_APPCPU

View File

@ -0,0 +1,15 @@
# ESP32-ETHERNET-KIT board configuration
# Copyright (c) 2022 Grant Ramsay <grant.ramsay@hotmail.com>
# SPDX-License-Identifier: Apache-2.0
if BOARD_ESP32_ETHERNET_KIT_ESP32_PROCPU
config ESP_SPIRAM
default y if !MCUBOOT
choice SPIRAM_TYPE
default SPIRAM_TYPE_ESPPSRAM64
endchoice
endif # BOARD_ESP32_ETHERNET_KIT_ESP32_PROCPU

View File

@ -0,0 +1,9 @@
# ESP32-ETHERNET-KIT board configuration
# Copyright (c) 2022 Grant Ramsay <grant.ramsay@hotmail.com>
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32_ETHERNET_KIT
select SOC_ESP32_WROVER_E_N4R8
select SOC_ESP32_PROCPU if BOARD_ESP32_ETHERNET_KIT_ESP32_PROCPU
select SOC_ESP32_APPCPU if BOARD_ESP32_ETHERNET_KIT_ESP32_APPCPU

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)

View File

@ -0,0 +1,6 @@
board:
name: esp32_ethernet_kit
full_name: ESP32-Ethernet-Kit
vendor: espressif
socs:
- name: esp32

View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2022 Grant Ramsay <grant.ramsay@hotmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/drivers/gpio.h>
#define IP101GRI_RESET_N_PIN 5
static int board_esp32_ethernet_kit_init(void)
{
const struct device *gpio = DEVICE_DT_GET(DT_NODELABEL(gpio0));
if (!device_is_ready(gpio)) {
return -ENODEV;
}
/* Enable the Ethernet phy */
int res = gpio_pin_configure(
gpio, IP101GRI_RESET_N_PIN,
GPIO_OUTPUT | GPIO_OUTPUT_INIT_HIGH);
return res;
}
SYS_INIT(board_esp32_ethernet_kit_init, PRE_KERNEL_2, CONFIG_GPIO_INIT_PRIORITY);

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -0,0 +1,621 @@
.. zephyr:board:: esp32_ethernet_kit
Overview
********
The ESP32-Ethernet-Kit is an Ethernet-to-Wi-Fi development board that enables
Ethernet devices to be interconnected over Wi-Fi. At the same time, to provide
more flexible power supply options, the ESP32-Ethernet-Kit also supports power
over Ethernet (PoE).
.. _get-started-esp32-ethernet-kit-v1.2-overview:
ESP32-Ethernet-Kit is an ESP32-WROVER-E based development.
For more information, check the datasheet at `ESP32-WROVER-E Datasheet`_.
It consists of two development boards, the Ethernet Board A and the PoE
board B. The `Ethernet Board (A)`_ contains Bluetooth/Wi-Fi dual-mode
ESP32-WROVER-E module and IP101GRI, a Single Port 10/100 Fast Ethernet
Transceiver (PHY). The `PoE Board (B)`_ provides power over Ethernet
functionality. The A board can work independently, without the board B
installed.
.. _get-started-esp32-ethernet-kit-v1.2:
.. figure:: img/esp32-ethernet-kit-v1.2.jpg
:align: center
:alt: ESP32-Ethernet-Kit V1.2
:figclass: align-center
ESP32-Ethernet-Kit V1.2
For the application loading and monitoring, the Ethernet Board (A) also
features FTDI FT2232H chip - an advanced multi-interface USB bridge.
This chip enables to use JTAG for direct debugging of ESP32 through the
USB interface without a separate JTAG debugger.
Hardware
********
Supported Features
==================
.. zephyr:board-supported-hw::
Functionality Overview
======================
The block diagram below shows the main components of ESP32-Ethernet-Kit
and their interconnections.
.. figure:: img/esp32-ethernet-kit-v1.1-block-diagram.jpg
:align: center
:alt: ESP32-Ethernet-Kit block diagram
:figclass: align-center
ESP32-Ethernet-Kit block diagram
Functional Description
----------------------
The following figures and tables describe the key components, interfaces,
and controls of the ESP32-Ethernet-Kit.
.. _get-started-esp32-ethernet-kit-a-v1.2-layout:
Ethernet Board (A)
^^^^^^^^^^^^^^^^^^
.. figure:: img/esp32-ethernet-kit-a-v1.2-layout.jpg
:align: center
:alt: ESP32-Ethernet-Kit V1.2
:figclass: align-center
ESP32-Ethernet-Kit - Ethernet Board (A) layout
The table below provides description starting from the picture's top right
corner and going clockwise.
.. list-table:: Table 1 Component Description
:widths: 40 150
:header-rows: 1
* - Key Component
- Description
* - ESP32-WROVER-E
- This ESP32 module features 64-Mbit PSRAM for flexible extended storage
and data processing capabilities.
* - GPIO Header 2
- Five unpopulated through-hole solder pads to provide access to selected
GPIOs of ESP32. For details, see `GPIO Header 2`_.
* - Function Switch
- A 4-bit DIP switch used to configure the functionality of selected GPIOs
of ESP32. For details see `Function Switch`_.
* - Tx/Rx LEDs
- Two LEDs to show the status of UART transmission.
* - FT2232H
- The FT2232H chip serves as a multi-protocol USB-to-serial bridge which
can be programmed and controlled via USB to provide communication with
ESP32. FT2232H also features USB-to-JTAG interface which is available
on channel A of the chip, while USB-to-serial is on channel B.
The FT2232H chip enhances user-friendliness in terms of application
development and debugging. See `ESP32-Ethernet-Kit V1.2 Ethernet Board (A) Schematic`_
* - USB Port
- USB interface. Power supply for the board as well as the communication
interface between a computer and the board.
* - Power Switch
- Power On/Off Switch. Toggling the switch to **5V0** position powers the
board on, toggling to **GND** position powers the board off.
* - 5V Input
- The 5 V power supply interface can be more convenient when the board is
operating autonomously (not connected to a computer).
* - 5V Power On LED
- This red LED turns on when power is supplied to the board, either from
USB or 5 V Input.
* - DC/DC Converter
- Provided DC 5 V to 3.3 V conversion, output current up to 2 A.
* - Board B Connectors
- A pair male and female header pins for mounting the `PoE Board (B)`_
* - IP101GRI (PHY)
- The physical layer (PHY) connection to the Ethernet cable is
implemented using the
`IP101GRI <http://www.bdtic.com/DataSheet/ICplus/IP101G_DS_R01_20121224.pdf>`_
chip. The connection between PHY and ESP32 is done through the reduced
media-independent interface (RMII), a variant of the media-independent
interface `(MII) <https://en.wikipedia.org/wiki/Media-independent_interface>`_
standard. The PHY supports the IEEE 802.3/802.3u standard of 10/100
Mbps.
* - RJ45 Port
- Ethernet network data transmission port.
* - Magnetics Module
- The Magnetics are part of the Ethernet specification to protect against
faults and transients, including rejection of common mode signals
between the transceiver IC and the cable. The magnetics also provide
galvanic isolation between the transceiver and the Ethernet device.
* - Link/Activity LEDs
- Two LEDs (green and red) that respectively indicate the "Link" and
"Activity" statuses of the PHY.
* - BOOT Button
- Download button. Holding down **BOOT** and then pressing **EN**
initiates Firmware Download mode for downloading firmware through the
serial port.
* - EN Button
- Reset button.
* - GPIO Header 1
- This header provides six unpopulated through-hole solder pads connected
to spare GPIOs of ESP32. For details, see `GPIO Header 1`_.
PoE Board (B)
^^^^^^^^^^^^^
This board coverts power delivered over the Ethernet cable (PoE) to provide a
power supply for the Ethernet Board (A). The main components of the PoE Board
(B) are shown on the block diagram under `Functionality Overview`_.
The PoE Board (B) has the following features:
* Support for IEEE 802.3at
* Power output: 5 V, 1.4 A
To take advantage of the PoE functionality the **RJ45 Port** of the Ethernet
board (A) should be connected with an Ethernet cable to a switch that supports
PoE. When the Ethernet Board (A) detects 5 V power output from the PoE Board
(B), the USB power will be automatically cut off.
.. figure:: img/esp32-ethernet-kit-b-v1.0-layout.jpg
:align: center
:alt: ESP32-Ethernet-Kit - PoE Board (B)
:figclass: align-center
ESP32-Ethernet-Kit - PoE Board (B) layout
.. list-table:: Table PoE Board (B)
:widths: 40 150
:header-rows: 1
* - Key Component
- Description
* - Board A Connector
- Four female (left) and four male (right) header pins for connecting the
PoE Board (B) to `Ethernet Board (A)`_. The pins on the left accept
power coming from a PoE switch. The pins on the right deliver 5 V power
supply to the Ethernet Board (A).
* - External Power Terminals
- Optional power supply (26.6 ~ 54 V) to the PoE Board (B).
.. _get-started-esp32-ethernet-kit-v1.2-setup-options:
Setup Options
=============
This section describes options to configure the ESP32-Ethernet-Kit hardware.
Function Switch
---------------
When in On position, this DIP switch is routing listed GPIOs to FT2232H to
provide JTAG functionality. When in Off position, the GPIOs may be used for
other purposes.
======= ================
DIP SW GPIO Pin
======= ================
1 GPIO13
2 GPIO12
3 GPIO15
4 GPIO14
======= ================
RMII Clock Selection
--------------------
The ethernet MAC and PHY under RMII working mode need a common 50 MHz
reference clock (i.e. RMII clock) that can be provided either externally,
or generated from internal ESP32 APLL (not recommended).
.. note::
For additional information on the RMII clock selection, please refer to
`ESP32-Ethernet-Kit V1.2 Ethernet Board (A) Schematic`_, sheet 2, location D2.
RMII Clock Sourced Externally by PHY
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, the ESP32-Ethernet-Kit is configured to provide RMII clock for the
IP101GRI PHY's 50M_CLKO output. The clock signal is generated by the frequency
multiplication of 25 MHz crystal connected to the PHY. For details, please see
the figure below.
.. figure:: img/esp32-ethernet-kit-rmii-clk-from-phy.jpg
:align: center
:alt: RMII Clock from IP101GRI PHY
:figclass: align-center
RMII Clock from IP101GRI PHY
Please note that the PHY is reset on power up by pulling the RESET_N signal
down with a resistor. ESP32 should assert RESET_N high with GPIO5 to enable
PHY. Only this can ensure the power-up of system. Otherwise ESP32 may enter
download mode (when the clock signal of REF_CLK_50M is at a high logic level
during the GPIO0 power-up sampling phase).
RMII Clock Sourced Internally from ESP32's APLL
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Another option is to source the RMII Clock from internal ESP32 APLL, see
figure below. The clock signal coming from GPIO0 is first inverted, to account
for transmission line delay, and then supplied to the PHY.
.. figure:: img/esp32-ethernet-kit-rmii-clk-to-phy.jpg
:align: center
:alt: RMII Clock from ESP Internal APLL
:figclass: align-center
RMII Clock from ESP Internal APLL
To implement this option, users need to remove or add some RC components on
the board. For details please refer to
`ESP32-Ethernet-Kit V1.2 Ethernet Board (A) Schematic`_,
sheet 2, location D2. Please note that if the APLL is already used for other
purposes (e.g. I2S peripheral), then you have no choice but use an external
RMII clock.
GPIO Allocation
---------------
This section describes allocation of ESP32 GPIOs to specific interfaces or
functions of the ESP32-Ethernet-Kit.
IP101GRI (PHY) Interface
^^^^^^^^^^^^^^^^^^^^^^^^
The allocation of the ESP32 (MAC) pins to IP101GRI (PHY) is shown in the table
below. Implementation of ESP32-Ethernet-Kit defaults to Reduced
Media-Independent Interface (RMII).
==== ================ ===============
No. ESP32 Pin (MAC) IP101GRI (PHY)
==== ================ ===============
*RMII Interface*
---------------------------------------
1 GPIO21 TX_EN
2 GPIO19 TXD[0]
3 GPIO22 TXD[1]
4 GPIO25 RXD[0]
5 GPIO26 RXD[1]
6 GPIO27 CRS_DV
7 GPIO0 REF_CLK
---- ---------------- ---------------
*Serial Management Interface*
---------------------------------------
8 GPIO23 MDC
9 GPIO18 MDIO
---- ---------------- ---------------
*PHY Reset*
---------------------------------------
10 GPIO5 Reset_N
==== ================ ===============
.. note::
The allocation of all pins under the ESP32's *RMII Interface* is fixed and
cannot be changed either through IO MUX or GPIO Matrix. REF_CLK can only
be selected from GPIO0, GPIO16 or GPIO17 and it can not be changed through
GPIO Matrix.
GPIO Header 1
^^^^^^^^^^^^^
This header exposes some GPIOs that are not used elsewhere on the
ESP32-Ethernet-Kit.
==== ================
No. ESP32 Pin
==== ================
1 GPIO32
2 GPIO33
3 GPIO34
4 GPIO35
5 GPIO36
6 GPIO39
==== ================
GPIO Header 2
^^^^^^^^^^^^^
This header contains GPIOs that may be used for other purposes depending on
scenarios described in column "Comments".
==== ========== ====================
No. ESP32 Pin Comments
==== ========== ====================
1 GPIO17 See note 1
2 GPIO16 See note 1
3 GPIO4
4 GPIO2
5 GPIO13 See note 2
6 GPIO12 See note 2
7 GPIO15 See note 2
8 GPIO14 See note 2
9 GND Ground
10 3V3 3.3 V power supply
==== ========== ====================
.. note::
1. The ESP32 pins GPIO16 and GPIO17 are not broken out to the
ESP32-WROVER-E module and therefore not available for use. If you need
to use these pins, please solder a module without PSRAM memory inside,
e.g. the ESP32-WROOM-32D or ESP32-SOLO-1.
2. Functionality depends on the settings of the `Function Switch`_.
GPIO Allocation Summary
^^^^^^^^^^^^^^^^^^^^^^^
.. csv-table::
:header: ESP32-WROVER-E,IP101GRI,UART,JTAG,GPIO,Comments
S_VP,,,,IO36,
S_VN,,,,IO39,
IO34,,,,IO34,
IO35,,,,IO35,
IO32,,,,IO32,
IO33,,,,IO33,
IO25,RXD[0],,,,
IO26,RXD[1],,,,
IO27,CRS_DV,,,,
IO14,,,TMS,IO14,
IO12,,,TDI,IO12,
IO13,,,TCK,IO13,
IO15,,,TDO,IO15,
IO2,,,,IO2,
IO0,REF_CLK,,,,See note 1
IO4,,,,IO4,
IO16,,,,IO16 (NC),See note 2
IO17,,,,IO17 (NC),See note 2
IO5,Reset_N,,,,See note 1
IO18,MDIO,,,,
IO19,TXD[0],,,,
IO21,TX_EN,,,,
RXD0,,RXD,,,
TXD0,,TXD,,,
IO22,TXD[1],,,,
IO23,MDC,,,,
.. note::
1. To prevent the power-on state of the GPIO0 from being affected by the
clock output on the PHY side, the RESET_N signal to PHY defaults to
low, turning the clock output off. After power-on you can control
RESET_N with GPIO5 to turn the clock output on. See also
`RMII Clock Sourced Externally by PHY`_. For PHYs that cannot turn off
the clock output through RESET_N, it is recommended to use a crystal
module that can be disabled/enabled externally. Similarly like when
using RESET_N, the oscillator module should be disabled by default and
turned on by ESP32 after power-up. For a reference design please see
`ESP32-Ethernet-Kit V1.2 Ethernet Board (A) Schematic`_.
2. The ESP32 pins GPIO16 and GPIO17 are not broken out to the
ESP32-WROVER-E module and therefore not available for use. If you need
to use these pins, please solder a module without PSRAM memory inside,
e.g. the ESP32-WROOM-32D or ESP32-SOLO-1.
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
*******************
.. zephyr:board-supported-runners::
Simple boot
===========
The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.
.. note::
Simple boot does not provide any security features nor OTA updates.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be built (and flashed) 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.
.. code:: cfg
CONFIG_BOOTLOADER_MCUBOOT=y
Sysbuild
========
The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the ESP32 SoC.
To build the sample application using sysbuild use the command:
.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/hello_world
:board: esp32_ethernet_kit/esp32/procpu
: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 built 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: esp32_ethernet_kit/esp32/procpu
:goals: build
The usual ``flash`` target will work with the ``esp32_ethernet_kit`` board
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_ethernet_kit/esp32/procpu
: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! esp32_ethernet_kit
Debugging
*********
As with much custom hardware, the ESP32 modules require patches to
OpenOCD that are not upstreamed yet. Espressif maintains their own fork of
the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_.
The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the
``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>``
parameter when building.
Here is an example for building the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_ethernet_kit/esp32/procpu
:goals: build flash
:gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>
You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_ethernet_kit/esp32/procpu
:goals: debug
Enabling Ethernet
*****************
Enable Ethernet MAC, PHY and MDIO; add these to your device tree overlay:
.. code-block:: devicetree
&eth {
status = "okay";
};
&phy {
status = "okay";
};
&mdio {
status = "okay";
};
Enable Ethernet in KConfig:
.. code-block:: cfg
CONFIG_ETH_ESP32=y
CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y
Board Init
==========
RESET_N (GPIO5) is automatically set high to enable the Ethernet PHY
during board initialization (board_init.c)
References
**********
.. target-notes::
.. _`ESP32-Ethernet-Kit V1.2 Ethernet Board (A) Schematic`: https://dl.espressif.com/dl/schematics/SCH_ESP32-Ethernet-Kit_A_V1.2_20200528.pdf
.. _`ESP32-WROVER-E Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-wrover-e_esp32-wrover-ie_datasheet_en.pdf
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

View File

@ -0,0 +1,72 @@
/*
* Copyright (c) 2022-2025 Grant Ramsay <grant.ramsay@hotmail.com>
*
* 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;
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO12>,
<SPIM2_SCLK_GPIO14>,
<SPIM2_CSEL_GPIO15>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO13>;
output-low;
};
};
mdio_default: mdio_default {
group1 {
pinmux = <SMI_MDC_GPIO23>,
<SMI_MDIO_GPIO18>;
};
};
i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};
i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_O_WS_GPIO8>,
<I2S1_O_BCK_GPIO3>,
<I2S1_O_SD_GPIO9>,
<I2S1_I_WS_GPIO10>,
<I2S1_I_BCK_GPIO11>;
output-enable;
};
group2 {
pinmux = <I2S1_I_SD_GPIO12>;
input-enable;
};
};
};

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32/esp32_appcpu.dtsi>
#include <espressif/partitions_0x1000_amp.dtsi>
/ {
model = "Espressif ESP32-Ethernet-Kit 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";
};

View File

@ -0,0 +1,27 @@
identifier: esp32_ethernet_kit/esp32/appcpu
name: ESP32 ETHERNET KIT 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: espressif

View File

@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CLOCK_CONTROL=y

View File

@ -0,0 +1,107 @@
/*
* Copyright (c) 2022-2025 Grant Ramsay <grant.ramsay@hotmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32/esp32_wrover_e_n4r8.dtsi>
#include "esp32_ethernet_kit-pinctrl.dtsi"
#include <espressif/partitions_0x1000_amp.dtsi>
/ {
model = "Espressif ESP32-Ethernet-Kit PROCPU";
compatible = "espressif,esp32";
aliases {
uart-0 = &uart0;
watchdog0 = &wdt0;
};
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;
};
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};
&i2s1 {
pinctrl-0 = <&i2s1_default>;
pinctrl-names = "default";
status = "disabled";
};
&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
};
&timer0 {
status = "okay";
};
&timer1 {
status = "okay";
};
&timer2 {
status = "okay";
};
&timer3 {
status = "okay";
};
&trng0 {
status = "okay";
};
&mdio {
pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";
phy: ethernet-phy@1 {
compatible = "ethernet-phy";
status = "disabled";
reg = <1>;
};
};
&eth {
phy-handle = <&phy>;
};
&esp32_bt_hci {
status = "okay";
};
&wifi {
status = "okay";
};

View File

@ -0,0 +1,14 @@
identifier: esp32_ethernet_kit/esp32/procpu
name: ESP32 ETHERNET KIT PROCPU
type: mcu
arch: xtensa
toolchain:
- zephyr
supported:
- gpio
- watchdog
- uart
- nvs
- pwm
- i2s
vendor: espressif

View File

@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y

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,6 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096

View File

@ -0,0 +1,7 @@
# ESP32C3 devkitc board configuration
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32C3_DEVKITC
select SOC_ESP32C3_WROOM_02_N4

View File

@ -0,0 +1,10 @@
# Copyright (c) 2024 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)

View File

@ -0,0 +1,6 @@
board:
name: esp32c3_devkitc
full_name: ESP32-C3-DevKitC
vendor: espressif
socs:
- name: esp32c3

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,219 @@
.. zephyr:board:: esp32c3_devkitc
Overview
********
ESP32-C3-DevKitC-02 is an entry-level development board based on ESP32-C3-WROOM-02,
a general-purpose module with 4 MB SPI flash. This board integrates complete Wi-Fi and Bluetooth® Low Energy functions.
For more information, check `ESP32-C3-DevKitC`_.
Hardware
********
ESP32-C3 is a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC,
based on the open-source RISC-V architecture. It strikes the right balance of power,
I/O capabilities and security, thus offering the optimal cost-effective
solution for connected devices.
The availability of Wi-Fi and Bluetooth 5 (LE) connectivity not only makes the device configuration easy,
but it also facilitates a variety of use-cases based on dual connectivity.
The features include the following:
- 32-bit core RISC-V microcontroller with a maximum clock speed of 160 MHz
- 400 KB of internal RAM
- 802.11b/g/n/e/i
- A Bluetooth LE subsystem that supports features of Bluetooth 5 and Bluetooth Mesh
- Various peripherals:
- 12-bit ADC with up to 6 channels
- TWAI compatible with CAN bus 2.0
- Temperature sensor
- 3x SPI
- 1x I2S
- 1x I2C
- 2x UART
- LED PWM with up to 6 channels
- Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES)
For more information, check the datasheet at `ESP32-C3 Datasheet`_ or the technical reference
manual at `ESP32-C3 Technical Reference Manual`_.
Supported Features
==================
.. zephyr:board-supported-hw::
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
*******************
.. zephyr:board-supported-runners::
Simple boot
===========
The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.
.. note::
Simple boot does not provide any security features nor OTA updates.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be built (and flashed) 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.
.. code:: cfg
CONFIG_BOOTLOADER_MCUBOOT=y
Sysbuild
========
The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the ESP32 SoC.
To build the sample application using sysbuild use the command:
.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/hello_world
:board: esp32c3_devkitc
: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 built 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: esp32c3_devkitc
:goals: build
The usual ``flash`` target will work with the ``esp32c3_devkitc`` board
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_devkitc
: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! esp32c3_devkitc
Debugging
*********
As with much custom hardware, the ESP32-C3 modules require patches to
OpenOCD that are not upstreamed yet. Espressif maintains their own fork of
the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_.
The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the
``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>``
parameter when building.
Here is an example for building the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_devkitc
:goals: build flash
:gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>
You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_devkitc
:goals: debug
References
**********
.. target-notes::
.. _`ESP32-C3-DevKitC`: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c3/esp32-c3-devkitc-02/index.html
.. _`ESP32-C3 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf
.. _`ESP32-C3 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <dt-bindings/pinctrl/esp32c3-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32c3-gpio-sigmap.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO21>;
output-high;
};
group2 {
pinmux = <UART0_RX_GPIO20>;
bias-pull-up;
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO2>,
<SPIM2_SCLK_GPIO6>,
<SPIM2_CSEL_GPIO10>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO7>;
output-low;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO1>,
<I2C0_SCL_GPIO3>;
bias-pull-up;
drive-open-drain;
output-high;
};
};
twai_default: twai_default {
group1 {
pinmux = <TWAI_TX_GPIO4>,
<TWAI_RX_GPIO5>;
};
};
};

View File

@ -0,0 +1,103 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32c3/esp32c3_wroom_n4.dtsi>
#include "esp32c3_devkitc-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <espressif/partitions_0x0_default.dtsi>
/ {
model = "Espressif ESP32C3-DevkitC";
compatible = "espressif,esp32c3";
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_button1;
i2c-0 = &i2c0;
watchdog0 = &wdt0;
};
gpio_keys {
compatible = "gpio-keys";
user_button1: button_1 {
label = "User SW1";
gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_0>;
};
};
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};
&usb_serial {
/* requires resoldering of resistors on the board */
status = "okay";
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};
&trng0 {
status = "okay";
};
&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
};
&gpio0 {
status = "okay";
};
&wdt0 {
status = "okay";
};
&timer0 {
status = "disabled";
};
&timer1 {
status = "disabled";
};
&twai {
/* requires external CAN transceiver or jumper on RX and TX pins for loopback testing */
status = "disabled";
pinctrl-0 = <&twai_default>;
pinctrl-names = "default";
};
&esp32_bt_hci {
status = "okay";
};
&wifi {
status = "okay";
};

View File

@ -0,0 +1,18 @@
identifier: esp32c3_devkitc
name: ESP32-C3
type: mcu
arch: riscv
toolchain:
- zephyr
supported:
- adc
- gpio
- i2c
- watchdog
- uart
- dma
- pwm
- spi
- counter
- entropy
vendor: espressif

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y

View File

@ -0,0 +1,11 @@
set ESP_RTOS none
# ESP32C3 has built-in JTAG interface over USB port in pins GPIO18/GPIO19 (D-/D+).
# Uncomment the line below to enable USB debugging.
# source [find interface/esp_usb_jtag.cfg]
# Otherwise, use external JTAG programmer as ESP-Prog
source [find interface/ftdi/esp32_devkitj_v1.cfg]
source [find target/esp32c3.cfg]
adapter speed 5000

View File

@ -0,0 +1,6 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096

View File

@ -0,0 +1,7 @@
# ESP32C3 devkitm board configuration
# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32C3_DEVKITM
select SOC_ESP32C3_MINI_N4

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)

View File

@ -0,0 +1,6 @@
board:
name: esp32c3_devkitm
full_name: ESP32-C3-DevKitM
vendor: espressif
socs:
- name: esp32c3

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,219 @@
.. zephyr:board:: esp32c3_devkitm
Overview
********
ESP32-C3-DevKitM is an entry-level development board based on ESP32-C3-MINI-1,
a module named for its small size. This board integrates complete Wi-Fi and Bluetooth® Low Energy functions.
For more information, check `ESP32-C3-DevKitM`_.
Hardware
********
ESP32-C3 is a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC,
based on the open-source RISC-V architecture. It strikes the right balance of power,
I/O capabilities and security, thus offering the optimal cost-effective
solution for connected devices.
The availability of Wi-Fi and Bluetooth 5 (LE) connectivity not only makes the device configuration easy,
but it also facilitates a variety of use-cases based on dual connectivity.
The features include the following:
- 32-bit core RISC-V microcontroller with a maximum clock speed of 160 MHz
- 400 KB of internal RAM
- 802.11b/g/n/e/i
- A Bluetooth LE subsystem that supports features of Bluetooth 5 and Bluetooth Mesh
- Various peripherals:
- 12-bit ADC with up to 6 channels
- TWAI compatible with CAN bus 2.0
- Temperature sensor
- 3x SPI
- 1x I2S
- 1x I2C
- 2x UART
- LED PWM with up to 6 channels
- Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES)
For more information, check the datasheet at `ESP32-C3 Datasheet`_ or the technical reference
manual at `ESP32-C3 Technical Reference Manual`_.
Supported Features
==================
.. zephyr:board-supported-hw::
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
*******************
.. zephyr:board-supported-runners::
Simple boot
===========
The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.
.. note::
Simple boot does not provide any security features nor OTA updates.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be built (and flashed) 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.
.. code:: cfg
CONFIG_BOOTLOADER_MCUBOOT=y
Sysbuild
========
The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the ESP32 SoC.
To build the sample application using sysbuild use the command:
.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/hello_world
:board: esp32c3_devkitm
: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 built 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: esp32c3_devkitm
:goals: build
The usual ``flash`` target will work with the ``esp32c3_devkitm`` board
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_devkitm
: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! esp32c3_devkitm
Debugging
*********
As with much custom hardware, the ESP32-C3 modules require patches to
OpenOCD that are not upstreamed yet. Espressif maintains their own fork of
the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_.
The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the
``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>``
parameter when building.
Here is an example for building the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_devkitm
:goals: build flash
:gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>
You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_devkitm
:goals: debug
References
**********
.. target-notes::
.. _`ESP32-C3-DevKitM`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html
.. _`ESP32-C3 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf
.. _`ESP32-C3 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

View File

@ -0,0 +1,66 @@
/*
* 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/esp32c3-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32c3-gpio-sigmap.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO21>;
output-high;
};
group2 {
pinmux = <UART0_RX_GPIO20>;
bias-pull-up;
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO2>,
<SPIM2_SCLK_GPIO6>,
<SPIM2_CSEL_GPIO10>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO7>;
output-low;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO1>,
<I2C0_SCL_GPIO3>;
bias-pull-up;
drive-open-drain;
output-high;
};
};
i2s_default: i2s_default {
group1 {
pinmux = <I2S_MCLK_GPIO6>,
<I2S_O_WS_GPIO5>,
<I2S_O_BCK_GPIO4>,
<I2S_O_SD_GPIO18>;
output-enable;
};
group2 {
pinmux = <I2S_I_SD_GPIO19>;
input-enable;
};
};
twai_default: twai_default {
group1 {
pinmux = <TWAI_TX_GPIO4>,
<TWAI_RX_GPIO5>;
};
};
};

View File

@ -0,0 +1,109 @@
/*
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32c3/esp32c3_mini_n4.dtsi>
#include "esp32c3_devkitm-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <espressif/partitions_0x0_default.dtsi>
/ {
model = "Espressif ESP32C3-DevkitM";
compatible = "espressif,esp32c3";
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_button1;
i2c-0 = &i2c0;
watchdog0 = &wdt0;
};
gpio_keys {
compatible = "gpio-keys";
user_button1: button_1 {
label = "User SW1";
gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_0>;
};
};
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};
&usb_serial {
/* requires resoldering of resistors on the board */
status = "okay";
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};
&i2s {
pinctrl-0 = <&i2s_default>;
pinctrl-names = "default";
status = "disabled";
};
&trng0 {
status = "okay";
};
&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
};
&gpio0 {
status = "okay";
};
&wdt0 {
status = "okay";
};
&timer0 {
status = "disabled";
};
&timer1 {
status = "disabled";
};
&twai {
/* requires external CAN transceiver or jumper on RX and TX pins for loopback testing */
status = "disabled";
pinctrl-0 = <&twai_default>;
pinctrl-names = "default";
};
&esp32_bt_hci {
status = "okay";
};
&wifi {
status = "okay";
};

View File

@ -0,0 +1,19 @@
identifier: esp32c3_devkitm
name: ESP32-C3
type: mcu
arch: riscv
toolchain:
- zephyr
supported:
- adc
- gpio
- i2c
- i2s
- watchdog
- uart
- dma
- pwm
- spi
- counter
- entropy
vendor: espressif

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y

View File

@ -0,0 +1,11 @@
set ESP_RTOS none
# ESP32C3 has built-in JTAG interface over USB port in pins GPIO18/GPIO19 (D-/D+).
# Uncomment the line below to enable USB debugging.
# source [find interface/esp_usb_jtag.cfg]
# Otherwise, use external JTAG programmer as ESP-Prog
source [find interface/ftdi/esp32_devkitj_v1.cfg]
source [find target/esp32c3.cfg]
adapter speed 5000

View File

@ -0,0 +1,6 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096

View File

@ -0,0 +1,5 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32C3_RUST
select SOC_ESP32C3_MINI_N4

View File

@ -0,0 +1,10 @@
# Copyright (c) 2024 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,10 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# 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)

View File

@ -0,0 +1,9 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
board:
name: esp32c3_rust
full_name: ESP32-C3-DevKit-RUST
vendor: espressif
socs:
- name: esp32c3

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,264 @@
.. zephyr:board:: esp32c3_rust
Overview
********
ESP32-C3-DevKit-RUST is based on the ESP32-C3, a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC,
based on the open-source RISC-V architecture. This special board also includes the ESP32-C3-MINI-1 module,
a 6DoF IMU, a temperature and humidity sensor, a Li-Ion battery charger, and a Type-C USB. The board is designed
to be easily used in training sessions, demonstrating its capabilities with all the board peripherals.
For more information, check `ESP32-C3-DevKit-RUST`_.
Hardware
********
SoC Features:
- IEEE 802.11 b/g/n-compliant
- Bluetooth 5, Bluetooth mesh
- 32-bit RISC-V single-core processor, up to 160MHz
- 384 KB ROM
- 400 KB SRAM (16 KB for cache)
- 8 KB SRAM in RTC
- 22 x programmable GPIOs
- 3 x SPI
- 2 x UART
- 1 x I2C
- 1 x I2S
- 2 x 54-bit general-purpose timers
- 3 x watchdog timers
- 1 x 52-bit system timer
- Remote Control Peripheral (RMT)
- LED PWM controller (LEDC)
- Full-speed USB Serial/JTAG controller
- General DMA controller (GDMA)
- 1 x TWAI®
- 2 x 12-bit SAR ADCs, up to 6 channels
- 1 x temperature sensor
For more information, check the datasheet at `ESP32-C3 Datasheet`_ or the technical reference
manual at `ESP32-C3 Technical Reference Manual`_.
Supported Features
==================
.. zephyr:board-supported-hw::
I2C Peripherals
===============
This board includes the following peripherals over the I2C bus:
+---------------------------+--------------+---------+
| Peripheral | Part number | Address |
+===========================+==============+=========+
| IMU | ICM-42670-P | 0x68 |
+---------------------------+--------------+---------+
| Temperature and Humidity | SHTC3 | 0x70 |
+---------------------------+--------------+---------+
I2C Bus Connection
==================
+---------+--------+
| Signal | GPIO |
+=========+========+
| SDA | GPIO10 |
+---------+--------+
| SCL | GPIO8 |
+---------+--------+
I/Os
====
The following devices are connected through GPIO:
+--------------+--------+
| I/O Devices | GPIO |
+==============+========+
| WS2812 LED | GPIO2 |
+--------------+--------+
| LED | GPIO7 |
+--------------+--------+
| Button/Boot | GPIO9 |
+--------------+--------+
Power
=====
* USB type-C (*no PD compatibility*).
* Li-Ion battery charger.
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
*******************
.. zephyr:board-supported-runners::
Simple boot
===========
The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.
.. note::
Simple boot does not provide any security features nor OTA updates.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be built (and flashed) 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.
.. code:: cfg
CONFIG_BOOTLOADER_MCUBOOT=y
Sysbuild
========
The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the ESP32 SoC.
To build the sample application using sysbuild use the command:
.. zephyr-app-commands::
:tool: west
:zephyr-app: samples/hello_world
:board: esp32c3_rust
: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 built 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: esp32c3_rust
:goals: build
The usual ``flash`` target will work with the ``esp32c3_rust`` board
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_rust
: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! esp32c3_rust
Debugging
*********
As with much custom hardware, the ESP32-C3 modules require patches to
OpenOCD that are not upstreamed yet. Espressif maintains their own fork of
the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_.
The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the
``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>``
parameter when building.
Here is an example for building the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_rust
:goals: build flash
:gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>
You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c3_rust
:goals: debug
References
**********
.. target-notes::
.. _`ESP32-C3-DevKit-RUST`: https://github.com/esp-rs/esp-rust-board/tree/v1.2
.. _`ESP32-C3 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf
.. _`ESP32-C3 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <dt-bindings/pinctrl/esp32c3-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32c3-gpio-sigmap.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO21>;
output-high;
};
group2 {
pinmux = <UART0_RX_GPIO20>;
bias-pull-up;
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO5>,
<SPIM2_SCLK_GPIO6>,
<SPIM2_CSEL_GPIO9>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO2>;
output-low;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO10>,
<I2C0_SCL_GPIO8>;
bias-pull-up;
drive-open-drain;
output-high;
};
};
};

View File

@ -0,0 +1,134 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32c3/esp32c3_mini_n4.dtsi>
#include "esp32c3_rust-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>
#include <espressif/partitions_0x0_default.dtsi>
/ {
model = "Espressif ESP32C3-RUST";
compatible = "espressif,esp32c3_rust";
chosen {
zephyr,sram = &sram1;
zephyr,console = &usb_serial;
zephyr,shell-uart = &usb_serial;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
aliases {
led0 = &red_led_0;
sw0 = &user_button1;
i2c-0 = &i2c0;
watchdog0 = &wdt0;
led-strip = &led_strip;
};
gpio_keys {
compatible = "gpio-keys";
user_button1: button_1 {
label = "User SW1";
gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_0>;
};
};
leds {
compatible = "gpio-leds";
red_led_0: led_0 {
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
label = "User LD0";
};
};
};
&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
/* Workaround to support WS2812 driver */
line-idle-low;
status = "okay";
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>; /* arbitrary; change at will */
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>;
};
};
&usb_serial {
status = "okay";
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
icm42670@68 {
compatible = "invensense,icm42670";
reg = <0x68>;
status = "okay";
accel-hz = <800>;
accel-fs = <16>;
gyro-hz = <800>;
gyro-fs = <2000>;
};
shtc3@70 {
compatible = "sensirion,shtc3", "sensirion,shtcx";
reg = <0x70>;
measure-mode = "normal";
clock-stretching;
};
};
&trng0 {
status = "okay";
};
&gpio0 {
status = "okay";
};
&wdt0 {
status = "okay";
};
&uart0 {
status = "disabled";
};
&esp32_bt_hci {
status = "okay";
};
&wifi {
status = "okay";
};

View File

@ -0,0 +1,21 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
identifier: esp32c3_rust
name: ESP32-C3-DevKit-RUST-1
type: mcu
arch: riscv
toolchain:
- zephyr
supported:
- adc
- gpio
- i2c
- watchdog
- uart
- dma
- pwm
- spi
- counter
- entropy
vendor: espressif

View File

@ -0,0 +1,10 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_LED_STRIP=y
CONFIG_SENSOR=y

View File

@ -0,0 +1,11 @@
set ESP_RTOS none
# ESP32C3 has built-in JTAG interface over USB port in pins GPIO18/GPIO19 (D-/D+).
# Uncomment the line below to enable USB debugging.
source [find interface/esp_usb_jtag.cfg]
# Otherwise, use external JTAG programmer as ESP-Prog
source [find interface/ftdi/esp32_devkitj_v1.cfg]
source [find target/esp32c3.cfg]
adapter speed 5000

View File

@ -0,0 +1,7 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096 if BOARD_ESP32C6_DEVKITC_ESP32C6_HPCORE
default 256 if BOARD_ESP32C6_DEVKITC_ESP32C6_LPCORE

View File

@ -0,0 +1,9 @@
# ESP32C6 devkitc board configuration
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32C6_DEVKITC
select SOC_ESP32_C6_WROOM_1U_N8
select SOC_ESP32C6_HPCORE if BOARD_ESP32C6_DEVKITC_ESP32C6_HPCORE
select SOC_ESP32C6_LPCORE if BOARD_ESP32C6_DEVKITC_ESP32C6_LPCORE

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)

View File

@ -0,0 +1,6 @@
board:
name: esp32c6_devkitc
full_name: ESP32-C6-DevKitC
vendor: espressif
socs:
- name: esp32c6

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,285 @@
.. zephyr:board:: esp32c6_devkitc
Overview
********
ESP32-C6-DevKitC is an entry-level development board based on ESP32-C6-WROOM-1(U),
a general-purpose module with a 8 MB SPI flash. This board integrates complete Wi-Fi,
Bluetooth LE, Zigbee, and Thread functions. For more information, check `ESP32-C6-DevKitC`_.
Hardware
********
ESP32-C6 is Espressif's first Wi-Fi 6 SoC integrating 2.4 GHz Wi-Fi 6, Bluetooth 5.3 (LE) and the
802.15.4 protocol. ESP32-C6 achieves an industry-leading RF performance, with reliable security
features and multiple memory resources for IoT products.
It consists of a high-performance (HP) 32-bit RISC-V processor, which can be clocked up to 160 MHz,
and a low-power (LP) 32-bit RISC-V processor, which can be clocked up to 20 MHz.
It has a 320KB ROM, a 512KB SRAM, and works with external flash.
ESP32-C6-DevKitC is an entry-level development board based on ESP32-C6-WROOM-1(U),
a general-purpose module with a 8 MB SPI flash.
Most of the I/O pins are broken out to the pin headers on both sides for easy interfacing.
Developers can either connect peripherals with jumper wires or mount ESP32-C6-DevKitC on
a breadboard.
ESP32-C6 includes the following features:
- 32-bit core RISC-V microcontroller with a clock speed of up to 160 MHz
- 400 KB of internal RAM
- WiFi 802.11 ax 2.4GHz
- Fully compatible with IEEE 802.11b/g/n protocol
- Bluetooth LE: Bluetooth 5.3 certified
- Internal co-existence mechanism between Wi-Fi and Bluetooth to share the same antenna
- IEEE 802.15.4 (Zigbee and Thread)
Digital interfaces:
- 30x GPIOs (QFN40), or 22x GPIOs (QFN32)
- 2x UART
- 1x Low-power (LP) UART
- 1x General purpose SPI
- 1x I2C
- 1x Low-power (LP) I2C
- 1x I2S
- 1x Pulse counter
- 1x USB Serial/JTAG controller
- 1x TWAI® controller, compatible with ISO 11898-1 (CAN Specification 2.0)
- 1x SDIO 2.0 slave controller
- LED PWM controller, up to 6 channels
- 1x Motor control PWM (MCPWM)
- 1x Remote control peripehral
- 1x Parallel IO interface (PARLIO)
- General DMA controller (GDMA), with 3 transmit channels and 3 receive channels
- Event task matrix (ETM)
Analog interfaces:
- 1x 12-bit SAR ADCs, up to 7 channels
- 1x temperature sensor
Timers:
- 1x 52-bit system timer
- 1x 54-bit general-purpose timers
- 3x Watchdog timers
- 1x Analog watchdog timer
Low Power:
- Four power modes designed for typical scenarios: Active, Modem-sleep, Light-sleep, Deep-sleep
Security:
- Secure boot
- Flash encryption
- 4-Kbit OTP, up to 1792 bits for users
- Cryptographic hardware acceleration: (AES-128/256, ECC, HMAC, RSA, SHA, Digital signature, Hash)
- Random number generator (RNG)
For more information, check the datasheet at `ESP32-C6 Datasheet`_ or the technical reference
manual at `ESP32-C6 Technical Reference Manual`_.
Supported Features
==================
.. zephyr:board-supported-hw::
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
*******************
.. zephyr:board-supported-runners::
Simple boot
===========
The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.
.. note::
Simple boot does not provide any security features nor OTA updates.
MCUboot bootloader
==================
User may choose to use MCUboot bootloader instead. In that case the bootloader
must be built (and flashed) 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.
.. code:: cfg
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
:zephyr-app: samples/hello_world
:board: esp32c6_devkitc/esp32c6/hpcore
: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 built 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: esp32c6_devkitc/esp32c6/hpcore
:goals: build
The usual ``flash`` target will work with the ``esp32c6_devkitc`` board
configuration. Here is an example for the :zephyr:code-sample:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c6_devkitc/esp32c6/hpcore
: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! esp32c6_devkitc/esp32c6/hpcore
Debugging
*********
As with much custom hardware, the ESP32-C6 modules require patches to
OpenOCD that are not upstreamed yet. Espressif maintains their own fork of
the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_.
The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the
``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>``
parameter when building.
Here is an example for building the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c6_devkitc/esp32c6/hpcore
:goals: build flash
:gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>
You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32c6_devkitc/esp32c6/hpcore
:goals: debug
Low-Power CPU (LP CORE)
***********************
The ESP32-C6 SoC has two RISC-V cores: the High-Performance Core (HP CORE) and the Low-Power Core (LP CORE).
The LP Core features ultra low power consumption, an interrupt controller, a debug module and a system bus
interface for memory and peripheral access.
The LP Core is in sleep mode by default. It has two application scenarios:
- Power insensitive scenario: When the High-Performance CPU (HP Core) is active, the LP Core can assist the HP CPU with some speed and efficiency-insensitive controls and computations.
- Power sensitive scenario: When the HP CPU is in the power-down state to save power, the LP Core can be woken up to handle some external wake-up events.
For more information, check the datasheet at `ESP32-C6 Datasheet`_ or the technical reference
manual at `ESP32-C6 Technical Reference Manual`_.
The LP Core support is fully integrated with :ref:`sysbuild`. The user can enable the LP Core by adding
the following configuration to the project:
.. code:: cfg
CONFIG_ULP_COPROC_ENABLED=y
See :zephyr:code-sample-category:`lp-core` folder as code reference.
References
**********
.. target-notes::
.. _`ESP32-C6-DevKitC`: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/user_guide.html
.. _`ESP32-C6 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf
.. _`ESP32-C6 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <dt-bindings/pinctrl/esp32c6-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32c6-gpio-sigmap.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO16>;
output-high;
};
group2 {
pinmux = <UART0_RX_GPIO17>;
bias-pull-up;
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO2>,
<SPIM2_SCLK_GPIO6>,
<SPIM2_CSEL_GPIO10>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO7>;
output-low;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO6>,
<I2C0_SCL_GPIO7>;
bias-pull-up;
drive-open-drain;
output-high;
};
};
};

View File

@ -0,0 +1,77 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32c6/esp32c6_wroom_n8.dtsi>
#include "esp32c6_devkitc_hpcore-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <espressif/partitions_0x0_default.dtsi>
/ {
model = "esp32c6_devkitc HP Core";
compatible = "espressif,esp32c6";
chosen {
zephyr,sram = &sramhp;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
aliases {
sw0 = &user_button1;
watchdog0 = &wdt0;
};
gpio_keys {
compatible = "gpio-keys";
user_button1: button_1 {
label = "User SW1";
gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_0>;
};
};
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};
&trng0 {
status = "okay";
};
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};
&spi2 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
};
&gpio0 {
status = "okay";
};
&wdt0 {
status = "okay";
};
&wifi {
status = "okay";
};

View File

@ -0,0 +1,22 @@
identifier: esp32c6_devkitc/esp32c6/hpcore
name: ESP32-C6-DevKitC HP Core
vendor: espressif
type: mcu
arch: riscv
toolchain:
- zephyr
supported:
- adc
- gpio
- watchdog
- uart
- dma
- pwm
- spi
- counter
- entropy
- i2c
- i2s
testing:
ignore_tags:
- bluetooth

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_GPIO=y

View File

@ -0,0 +1,26 @@
/*
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <espressif/esp32c6/esp32c6_lpcore_wroom_n4.dtsi>
#include <espressif/partitions_0x0_default.dtsi>
/ {
model = "Espressif ESP32C6-DevkitC LPCORE";
compatible = "espressif,esp32c6";
chosen {
zephyr,sram = &sramlp;
zephyr,code-partition = &slot0_lpcore_partition;
zephyr,console = &lp_uart;
zephyr,shell-uart = &lp_uart;
};
};
&lp_uart {
status = "okay";
current-speed = <115200>;
};

View File

@ -0,0 +1,19 @@
identifier: esp32c6_devkitc/esp32c6/lpcore
name: ESP32-C6-DevKitC LP Core
type: mcu
arch: riscv
toolchain:
- zephyr
supported:
- cpu
- uart
- serial
testing:
only_tags:
- introduction
ignore_tags:
- kernel
- posix
- chre
- cpp
vendor: espressif

View File

@ -0,0 +1,20 @@
# Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
# Memory protection
CONFIG_THREAD_STACK_INFO=n
CONFIG_THREAD_CUSTOM_DATA=n
# Boot
CONFIG_BOOT_BANNER=n
# Console
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PRINTK=n
CONFIG_CBPRINTF_NANO=y
# Build
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_BUSYWAIT_CPU_LOOPS_PER_USEC=4

View File

@ -0,0 +1,4 @@
# ESP32C6 has built-in JTAG interface over USB port in pins GPIO13/GPIO12 (D-/D+).
set ESP_RTOS none
source [find board/esp32c6-builtin.cfg]

View File

@ -0,0 +1,6 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096

View File

@ -0,0 +1,5 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0
config BOARD_ESP32S2_DEVKITC
select SOC_ESP32S2_SOLO_N4R2

View File

@ -0,0 +1,10 @@
# Copyright (c) 2024 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)

View File

@ -0,0 +1,6 @@
board:
name: esp32s2_devkitc
full_name: ESP32-S2-DevKitC
vendor: espressif
socs:
- name: esp32s2

Some files were not shown because too many files have changed in this diff Show More