diff --git a/boards/weact/esp32c3_mini/Kconfig b/boards/weact/esp32c3_mini/Kconfig new file mode 100644 index 0000000000000..36a21f585307e --- /dev/null +++ b/boards/weact/esp32c3_mini/Kconfig @@ -0,0 +1,6 @@ +# Copyright (c) 2025 Siratul Islam +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 diff --git a/boards/weact/esp32c3_mini/Kconfig.sysbuild b/boards/weact/esp32c3_mini/Kconfig.sysbuild new file mode 100644 index 0000000000000..ac46996c6cca4 --- /dev/null +++ b/boards/weact/esp32c3_mini/Kconfig.sysbuild @@ -0,0 +1,11 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2025 Siratul Islam +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/weact/esp32c3_mini/Kconfig.weact_esp32c3_mini b/boards/weact/esp32c3_mini/Kconfig.weact_esp32c3_mini new file mode 100644 index 0000000000000..3ec718522b66b --- /dev/null +++ b/boards/weact/esp32c3_mini/Kconfig.weact_esp32c3_mini @@ -0,0 +1,7 @@ +# ESP32-C6-Mini board configuration + +# Copyright (c) 2025 Siratul Islam +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_WEACT_ESP32C3_MINI + select SOC_ESP32C3_FH4 diff --git a/boards/weact/esp32c3_mini/board.cmake b/boards/weact/esp32c3_mini/board.cmake new file mode 100644 index 0000000000000..2f04d1fe8861e --- /dev/null +++ b/boards/weact/esp32c3_mini/board.cmake @@ -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) diff --git a/boards/weact/esp32c3_mini/board.yml b/boards/weact/esp32c3_mini/board.yml new file mode 100644 index 0000000000000..2aa6bd3958f7f --- /dev/null +++ b/boards/weact/esp32c3_mini/board.yml @@ -0,0 +1,6 @@ +board: + name: weact_esp32c3_mini + full_name: ESP32-C3-Mini + vendor: weact + socs: + - name: esp32c3 diff --git a/boards/weact/esp32c3_mini/doc/img/weact_esp32c3_mini.webp b/boards/weact/esp32c3_mini/doc/img/weact_esp32c3_mini.webp new file mode 100644 index 0000000000000..482586fab68ea Binary files /dev/null and b/boards/weact/esp32c3_mini/doc/img/weact_esp32c3_mini.webp differ diff --git a/boards/weact/esp32c3_mini/doc/index.rst b/boards/weact/esp32c3_mini/doc/index.rst new file mode 100644 index 0000000000000..bce8e2d05326d --- /dev/null +++ b/boards/weact/esp32c3_mini/doc/index.rst @@ -0,0 +1,83 @@ +.. zephyr:board:: weact_esp32c3_mini + +Overview +******** + +WeAct Studio ESP32-C3-Mini is a compact development board based on ESP32-C3FH4, +featuring integrated Wi-Fi and Bluetooth® Low Energy connectivity. +For more information, check `WeAct Studio ESP32-C3 Core Board`_. + +Hardware +******** + +ESP32-C3 is a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC, +based on the open-source RISC-V architecture. + +The features include the following: + +- 32-bit core RISC-V microcontroller with a maximum clock speed of 160 MHz +- 400 KB of internal RAM +- 4 MB of internal flash (FH4 variant) +- 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) +- USB Serial/JTAG for flashing and debugging +- On-board blue LED (GPIO8) +- Boot button (GPIO9) + +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 +******************* + +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`. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +.. include:: ../../../espressif/common/building-flashing.rst + :start-after: espressif-building-flashing + +Debugging +========= + +.. include:: ../../../espressif/common/openocd-debugging.rst + :start-after: espressif-openocd-debugging + +References +********** + +.. target-notes:: + +.. _`WeAct Studio ESP32-C3 Core Board`: https://github.com/WeActStudio/WeActStudio.ESP32C3CoreBoard +.. _`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 diff --git a/boards/weact/esp32c3_mini/support/openocd.cfg b/boards/weact/esp32c3_mini/support/openocd.cfg new file mode 100644 index 0000000000000..0ad11b02ae919 --- /dev/null +++ b/boards/weact/esp32c3_mini/support/openocd.cfg @@ -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 diff --git a/boards/weact/esp32c3_mini/weact_esp32c3_mini-pinctrl.dtsi b/boards/weact/esp32c3_mini/weact_esp32c3_mini-pinctrl.dtsi new file mode 100644 index 0000000000000..e54bad10d5a3a --- /dev/null +++ b/boards/weact/esp32c3_mini/weact_esp32c3_mini-pinctrl.dtsi @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025 Siratul Islam + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + + group2 { + pinmux = ; + output-low; + }; + }; +}; diff --git a/boards/weact/esp32c3_mini/weact_esp32c3_mini.dts b/boards/weact/esp32c3_mini/weact_esp32c3_mini.dts new file mode 100644 index 0000000000000..5ad75fb779bfb --- /dev/null +++ b/boards/weact/esp32c3_mini/weact_esp32c3_mini.dts @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2025 Siratul Islam + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "weact_esp32c3_mini-pinctrl.dtsi" +#include +#include + +/ { + model = "WeAct Studio ESP32-C3-Mini"; + compatible = "weact,esp32c3-mini"; + + chosen { + zephyr,sram = &sram1; + zephyr,console = &usb_serial; + zephyr,shell-uart = &usb_serial; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + }; + + aliases { + sw0 = &button0; + led0 = &blue_led; + i2c-0 = &i2c0; + watchdog0 = &wdt0; + }; + + leds { + compatible = "gpio-leds"; + + blue_led: blue_led { + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + label = "User LED"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + button0: button_0 { + label = "BOOT Button"; + gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&usb_serial { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + 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"; +}; + +&esp32_bt_hci { + status = "okay"; +}; + +&wifi { + status = "okay"; +}; diff --git a/boards/weact/esp32c3_mini/weact_esp32c3_mini.yaml b/boards/weact/esp32c3_mini/weact_esp32c3_mini.yaml new file mode 100644 index 0000000000000..deba68f72e0d4 --- /dev/null +++ b/boards/weact/esp32c3_mini/weact_esp32c3_mini.yaml @@ -0,0 +1,19 @@ +identifier: weact_esp32c3_mini +name: WeAct Studio ESP32-C3-Mini +type: mcu +arch: riscv +toolchain: + - zephyr +supported: + - adc + - gpio + - i2c + - i2s + - watchdog + - uart + - dma + - pwm + - spi + - counter + - entropy +vendor: weact diff --git a/boards/weact/esp32c3_mini/weact_esp32c3_mini_defconfig b/boards/weact/esp32c3_mini/weact_esp32c3_mini_defconfig new file mode 100644 index 0000000000000..187793c76e8cc --- /dev/null +++ b/boards/weact/esp32c3_mini/weact_esp32c3_mini_defconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y