Initial import

This commit is contained in:
2026-03-25 18:14:45 +01:00
commit d074cd2e43
99 changed files with 3781 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
if BOARD_HELTEC_WIFI_LORA32_V4
config BOARD
default "heltec_wifi_lora32_v4"
endif # BOARD_HELTEC_WIFI_LORA32_V4

View File

@@ -0,0 +1,3 @@
config BOARD_HELTEC_WIFI_LORA32_V4
select SOC_ESP32S3_PROCPU if BOARD_HELTEC_WIFI_LORA32_V4_PROCPU
select SOC_ESP32S3_APPCPU if BOARD_HELTEC_WIFI_LORA32_V4_APPCPU

View File

@@ -0,0 +1,3 @@
# Heltec WiFi LoRa 32 V4 — board.cmake
# Uses esptool for flashing over USB-C (direct ESP32-S3 USB)
include(${ZEPHYR_BASE}/boards/espressif/common/board.cmake)

View File

@@ -0,0 +1,10 @@
board:
name: heltec_wifi_lora32_v4
full_name: "Heltec WiFi LoRa 32 V4"
vendor: heltec
url: https://heltec.org/project/wifi-lora-32-v4/
socs:
- name: esp32s3
variants:
- name: procpu
- name: appcpu

View File

@@ -0,0 +1,23 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Heltec WiFi LoRa 32 V4 — pin control definitions
*/
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <dt-bindings/pinctrl/esp32s3-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h>
&pinctrl {
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO11>,
<SPIM2_SCLK_GPIO9>,
<SPIM2_CSEL_GPIO8>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO10>;
output-enable;
};
};
};

View File

@@ -0,0 +1,111 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Heltec WiFi LoRa 32 V4 — Device Tree Source (PROCPU)
*
* Based on Heltec WiFi LoRa 32 V3 with the following differences:
* - No CP2102 USB-UART bridge; direct ESP32-S3 USB-C
* - Console routed to usb_serial instead of uart0
*/
/dts-v1/;
#include <espressif/esp32s3/esp32s3_fn8r2.dtsi>
#include "heltec_wifi_lora32_v4-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Heltec WiFi LoRa 32 V4 PROCPU";
compatible = "heltec,wifi-lora-32-v4";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &usb_serial;
zephyr,shell-uart = &usb_serial;
zephyr,flash-controller = &flash;
};
aliases {
lora0 = &lora;
led0 = &led_white;
};
leds {
compatible = "gpio-leds";
led_white: led_0 {
/* V4 LED pin — verify from schematic */
gpios = <&gpio0 35 GPIO_ACTIVE_HIGH>;
label = "White LED";
};
};
buttons {
compatible = "gpio-keys";
boot_button: button_0 {
gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Boot Button";
zephyr,code = <INPUT_KEY_0>;
};
};
};
&usb_serial {
status = "okay";
};
&uart0 {
status = "disabled";
};
&spi2 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
lora: lora@0 {
compatible = "semtech,sx1262";
reg = <0>;
spi-max-frequency = <4000000>;
reset-gpios = <&gpio0 12 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
busy-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
dio1-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
dio2-tx-enable;
tcxo-power-startup-delay-ms = <5>;
};
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x00010000>;
};
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x00300000>;
};
slot1_partition: partition@310000 {
label = "image-1";
reg = <0x00310000 0x00300000>;
};
storage_partition: partition@610000 {
label = "storage";
reg = <0x00610000 0x001f0000>;
};
};
};

View File

@@ -0,0 +1,7 @@
CONFIG_SOC_SERIES_ESP32S3=y
CONFIG_BOARD_HELTEC_WIFI_LORA32_V4=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_UART_CONSOLE=y
CONFIG_SPI=y
CONFIG_GPIO=y