From 6b86f5edf48185cf2b49c0b3cdcf947c7056a922 Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Sun, 29 Jun 2025 11:48:27 +0200 Subject: [PATCH] initial try --- boards/dfrobot/firebeetle2_esp32c6/Kconfig | 7 ++ .../Kconfig.firebeetle2_esp32c6 | 9 +++ .../firebeetle2_esp32c6/Kconfig.sysbuild | 10 +++ .../dfrobot/firebeetle2_esp32c6/board.cmake | 9 +++ boards/dfrobot/firebeetle2_esp32c6/board.yml | 6 ++ .../firebeetle2_esp32c6_hpcore-pinctrl.dtsi | 45 +++++++++++ .../firebeetle2_esp32c6_hpcore.dts | 76 +++++++++++++++++++ .../firebeetle2_esp32c6_hpcore.yaml | 22 ++++++ .../firebeetle2_esp32c6_hpcore_defconfig | 6 ++ .../firebeetle2_esp32c6_lpcore.dts | 26 +++++++ .../firebeetle2_esp32c6_lpcore.yaml | 19 +++++ .../firebeetle2_esp32c6_lpcore_defconfig | 20 +++++ 12 files changed, 255 insertions(+) create mode 100644 boards/dfrobot/firebeetle2_esp32c6/Kconfig create mode 100644 boards/dfrobot/firebeetle2_esp32c6/Kconfig.firebeetle2_esp32c6 create mode 100644 boards/dfrobot/firebeetle2_esp32c6/Kconfig.sysbuild create mode 100644 boards/dfrobot/firebeetle2_esp32c6/board.cmake create mode 100644 boards/dfrobot/firebeetle2_esp32c6/board.yml create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore-pinctrl.dtsi create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.dts create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.yaml create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore_defconfig create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.dts create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.yaml create mode 100644 boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore_defconfig diff --git a/boards/dfrobot/firebeetle2_esp32c6/Kconfig b/boards/dfrobot/firebeetle2_esp32c6/Kconfig new file mode 100644 index 0000000..2a0b553 --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/Kconfig @@ -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_FIREBEETLE2_ESP32C6_ESP32C6_HPCORE + default 256 if BOARD_FIREBEETLE2_ESP32C6_ESP32C6_LPCORE diff --git a/boards/dfrobot/firebeetle2_esp32c6/Kconfig.firebeetle2_esp32c6 b/boards/dfrobot/firebeetle2_esp32c6/Kconfig.firebeetle2_esp32c6 new file mode 100644 index 0000000..47552a9 --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/Kconfig.firebeetle2_esp32c6 @@ -0,0 +1,9 @@ +# ESP32C6 devkitc board configuration + +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_FIREBEETLE2_ESP32C6 + select SOC_ESP32_C6_WROOM_1U_N4 + select SOC_ESP32C6_HPCORE if BOARD_ESP32C6_DEVKITC_ESP32C6_HPCORE + select SOC_ESP32C6_LPCORE if BOARD_ESP32C6_DEVKITC_ESP32C6_LPCORE diff --git a/boards/dfrobot/firebeetle2_esp32c6/Kconfig.sysbuild b/boards/dfrobot/firebeetle2_esp32c6/Kconfig.sysbuild new file mode 100644 index 0000000..3a2d17a --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/Kconfig.sysbuild @@ -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 diff --git a/boards/dfrobot/firebeetle2_esp32c6/board.cmake b/boards/dfrobot/firebeetle2_esp32c6/board.cmake new file mode 100644 index 0000000..2f04d1f --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/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/dfrobot/firebeetle2_esp32c6/board.yml b/boards/dfrobot/firebeetle2_esp32c6/board.yml new file mode 100644 index 0000000..a630d1b --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/board.yml @@ -0,0 +1,6 @@ +board: + name: firebeetle2_esp32c6 + full_name: FireBeetle 2 ESP32-C6 + vendor: dfrobot + socs: + - name: esp32c6 diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore-pinctrl.dtsi b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore-pinctrl.dtsi new file mode 100644 index 0000000..5265d5e --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore-pinctrl.dtsi @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; +}; diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.dts b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.dts new file mode 100644 index 0000000..77f1fa0 --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.dts @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "firebeetle2_esp32c6_hpcore-pinctrl.dtsi" +#include +#include + +/ { + model = "DFRobot Firebeetle2 ESP32C6 HP Core"; + compatible = "espressif,esp32c6"; + + chosen { + zephyr,sram = &sramhp; + zephyr,console = &usb_serial; + zephyr,shell-uart = &usb_serial; + 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 = ; + }; + }; +}; + +&uart0 { + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&trng0 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + 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"; +}; diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.yaml b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.yaml new file mode 100644 index 0000000..72bef16 --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore.yaml @@ -0,0 +1,22 @@ +identifier: firebeetle2_esp32c6/esp32c6/hpcore +name: Firebeetle 2 ESP32C6 HP Core +vendor: dfrobot +type: mcu +arch: riscv +toolchain: + - zephyr +supported: + - adc + - gpio + - watchdog + - uart + - dma + - pwm + - spi + - counter + - entropy + - i2c + - i2s +testing: + ignore_tags: + - bluetooth diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore_defconfig b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore_defconfig new file mode 100644 index 0000000..187793c --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_hpcore_defconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.dts b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.dts new file mode 100644 index 0000000..cc2fc5e --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.dts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include + +/ { + model = "DFRobot FireBeetle2 ESP32-C6 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>; +}; diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.yaml b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.yaml new file mode 100644 index 0000000..7a8b767 --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore.yaml @@ -0,0 +1,19 @@ +identifier: firebeetle2_esp32c6/esp32c6/lpcore +name: FireBeetle2 ESP32-C6 LPCore +type: mcu +arch: riscv +toolchain: + - zephyr +supported: + - cpu + - uart + - serial +testing: + only_tags: + - introduction + ignore_tags: + - kernel + - posix + - chre + - cpp +vendor: dfrobot diff --git a/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore_defconfig b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore_defconfig new file mode 100644 index 0000000..0497409 --- /dev/null +++ b/boards/dfrobot/firebeetle2_esp32c6/firebeetle2_esp32c6_lpcore_defconfig @@ -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