This commit is contained in:
Rastislav Vysoky committed 2026-04-07 19:05:32 +02:00
1 parent 2af08b251b
commit da22b127c3
16 files changed
+572 -1

No files matched your search

@@ -0,0 +1,37 @@
# TTGO LoRa32 — ESP32 + SX1276
#
# Hardware:
# ESP32 (4MB flash)
# SX1276 on SPI3
# SSD1306 128x64 OLED on I2C0
#
# Include order: prj.conf → zephcore_common.conf → esp32_common.conf → board.conf
# Board identification
CONFIG_ZEPHCORE_BOARD_NAME="TTGO LoRa32"
CONFIG_BT_DIS_MODEL_NUMBER_STR="TTGO LoRa32"
# Radio: SX1276 via Zephyr loramac-node driver (not the native SX126x driver)
# zephcore_common.conf sets CONFIG_LORA_MODULE_BACKEND_NATIVE=y for SX126x boards.
# Override here: SX127x uses the loramac-node backend (classic LoRaMac-node library).
CONFIG_LORA_MODULE_BACKEND_NATIVE=n
CONFIG_LORA_MODULE_BACKEND_LORAMAC_NODE=y
CONFIG_ZEPHCORE_RADIO_SX127X=y
# SX1276 PA_BOOST output: 17 dBm is the safe maximum without an external PA
CONFIG_ZEPHCORE_DEFAULT_TX_POWER_DBM=17
CONFIG_ZEPHCORE_MAX_TX_POWER_DBM=17
# RX duty cycle is not supported by the loramac-node SX127x driver
# (lora_recv_duty_cycle returns -ENOSYS and gracefully falls back to
# lora_recv_async, but disable it to avoid the spurious attempt)
CONFIG_ZEPHCORE_LORA_RX_DUTY_CYCLE=n
# Flash mode: ESP32-PICO-D4 (rev 1.0) — use DIO, not QIO.
# esp32_common.conf enables QIO for the ESP32-S3/C3/C6 boards in this repo.
# Classic ESP32 PICO-D4 rev 1.0 has an issue where bootloader_enable_qio_mode()
# polls the SPI flash WIP bit indefinitely; this hangs with no output after the
# chip-revision "Proceeding" message, the RTCWDT fires, and the board bootloops.
# DIO avoids the QIO-enable SPI sequence entirely and works reliably on PICO-D4.
CONFIG_ESPTOOLPY_FLASHMODE_QIO=n
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
@@ -0,0 +1,55 @@
/*
* SPDX-License-Identifier: Apache-2.0
* TTGO LoRa32 — ZephCore overlay
*
* The upstream Zephyr DTS (ttgo_lora32_esp32_procpu.dts) already defines:
* SX1276 on SPI3 (NSS=GPIO18, SCK/MOSI/MISO via pinctrl)
* SSD1306 OLED on I2C0 (SDA=GPIO21, SCL=GPIO22)
* UART0 console (TX=GPIO1, RX=GPIO3)
* LED0 on GPIO25, WiFi
*
* LoRa SPI3 pins: NSS=18, DIO0=26, DIO1=35, DIO2=34
* LoRa control: RESET=23
* Display I2C0: SDA=21, SCL=22 (SSD1306 @ 0x3C)
*
* Flash layout (partitions_0x1000_amp_4M.dtsi):
* storage_partition @ 0x3B0000 (192KB) — repurposed as LittleFS
*/
/ {
chosen {
/* UART0 console is correct for classic ESP32 (no native USB) */
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
};
};
/*
* Flash partitions — repurpose storage_partition as LittleFS.
* The 4MB layout has appcpu slots we don't use (procpu-only build),
* but we leave them to avoid changing the partition map.
*/
/delete-node/ &storage_partition;
&flash0 {
partitions {
/* LittleFS 192KB for DataStore (identity, prefs, creds) */
lfs_partition: partition@3b0000 {
label = "lfs";
reg = <0x3B0000 0x30000>;
};
};
};
/* LittleFS auto-mount — standard /lfs mount point */
#include "../../common/filesystem.dtsi"
/* WiFi — required for observer MQTT connectivity */
&wifi {
status = "okay";
};
/* I2C sensors — auto-detected at runtime */
&i2c0 {
#include "../../common/sensors-i2c.dtsi"
};