promicro fixes

This commit is contained in:
liquidraver
2026-09-10 22:40:15 +02:00
parent 69cc148fbe
commit c969b2fca3
3 changed files with 120 additions and 74 deletions
@@ -1,14 +1,53 @@
# ProMicro SX1262 — nRF52840 SuperMini + Ebyte E22-900M30S
# SoftDevice v6 (S140 v6) — NiceNano/SuperMini bootloader uses S140 6.1.1
# 0x00B6 = S140 v6 firmware ID; app partition starts at 0x26000
CONFIG_ZEPHCORE_BOARD_NAME="ProMicro SX1262"
CONFIG_BT_DIS_MODEL_NUMBER_STR="ProMicro SX1262 nRF52840-SX1262"
CONFIG_ZEPHCORE_SD_FWID=0x00B6
# Native Zephyr SX1262 driver (Ebyte E22-900M30S)
CONFIG_ZEPHCORE_RADIO_NATIVE=y
# E22-900M30S has 30dB external PA — default SX1262 output at 10 dBm
# to avoid PA damage on TX. Not capped — user can raise at their own risk.
CONFIG_ZEPHCORE_DEFAULT_TX_POWER_DBM=10
# ProMicro SX1262 — nRF52840 SuperMini + an SX1262 module
# Generic target: built both with the Ebyte E22-900M30S (30 dB PA) and with
# bare no-PA modules (HT-RA62, E22-900M22S). See the TX power note below.
# SoftDevice v6 (S140 v6) — NiceNano/SuperMini bootloader uses S140 6.1.1
# 0x00B6 = S140 v6 firmware ID; app partition starts at 0x26000
CONFIG_ZEPHCORE_BOARD_NAME="ProMicro SX1262"
CONFIG_BT_DIS_MODEL_NUMBER_STR="ProMicro SX1262 nRF52840-SX1262"
CONFIG_ZEPHCORE_SD_FWID=0x00B6
# Native Zephyr SX1262 driver
CONFIG_ZEPHCORE_RADIO_NATIVE=y
# TX power defaults to the SAFE value for the E22-900M30S, whose 30 dB external
# PA is damaged by a hot drive: 10 dBm in, ~30 dBm at the antenna.
#
# This target is also built with bare SX1262 modules that have no PA at all
# (HT-RA62, E22-900M22S). On those, 10 dBm IS the antenna power — 12 dB below
# the 22 dBm official MeshCore ships for the same variant (LORA_TX_POWER=22 in
# variants/promicro/platformio.ini). The symptom is a node close neighbours can
# still hear, that gets zero repeats and fails 0-hop pings to repeaters.
#
# The default stays conservative because the failure modes are not symmetric:
# too little power costs range and is fixable in the app, too much destroys a
# PA permanently. With no external PA, use "set tx 22" after the first flash —
# this is a first-boot pref only, so the new value sticks.
CONFIG_ZEPHCORE_DEFAULT_TX_POWER_DBM=10
# 32.768 kHz source: calibrated RC, not a crystal.
# The nRF52840 SuperMini/ProMicro clones do not fit an LFXO — official MeshCore
# says so outright in variants/promicro/variant.h ("//#define USE_LFXO" /
# "#define USE_LFRC"). Zephyr's default is CLOCK_CONTROL_NRF_K32SRC_XTAL with a
# 50 ppm accuracy claim, so without this the node runs the BLE controller and
# RTC1 (the kernel tick source) off a floating LFXO while telling the peer it is
# 50 ppm accurate: the central's receive windows stop landing on our anchor
# points and the link drops every few seconds, and every k_timer — including the
# LoRa RX duty-cycle windows and the post-TX RX restore — skews with it.
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
# Accuracy claimed to the BLE peer. Zephyr would pick 500 ppm here (its default
# for RC on nRF52); the Adafruit core that stock MeshCore builds on declares
# NRF_CLOCK_LF_ACCURACY_250_PPM for the same calibrated RC on the same silicon
# (libraries/Bluefruit52Lib/src/bluefruit.cpp, alongside rc_ctiv=16 /
# rc_temp_ctiv=2 — what RC_CALIBRATION above provides). Matched to stock so the
# central sizes its receive windows the same way on both firmwares.
CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM=y
# Compile in the UI display stack; the OLED panel is optional at runtime.
# SSD1306 on i2c0 (SDA P1.04 / SCL P0.11) — the same bus and pins official
# MeshCore drives via PIN_BOARD_SDA=8 / PIN_BOARD_SCL=7, and it builds every
# ProMicro env with DISPLAY_CLASS=SSD1306Display.
CONFIG_ZEPHCORE_UI_DISPLAY=y
@@ -1,15 +1,18 @@
/*
* ProMicro SX1262 — nRF52840 SuperMini + Ebyte E22-900M30S
* ProMicro SX1262 — nRF52840 SuperMini + SX1262 (generic; see board.conf)
* Copyright (c) 2025 ZephCore
*
* SPDX-License-Identifier: MIT
*
* Hardware:
* - nRF52840 (SuperMini/ProMicro form factor) with BLE 5
* - Ebyte E22-900M30S (SX1262 + 30dB PA), TCXO, DIO2=TXEN, RXEN on P0.17
* - SX1262 module: E22-900M30S (30dB PA) or a bare HT-RA62 / E22-900M22S;
* TCXO, DIO2=TXEN, RXEN on P0.17. TX power differs — see board.conf
* - GPS module on UART0 (9600 baud, P0.22 RX, P0.20 TX)
* - Battery ADC on AIN7 (P0.31), 150K+150K divider (2:1)
* - User button on P1.00, LED on P0.15
* - Optional SSD1306 128x64 OLED on I2C0 @ 0x3c (SDA P1.04, SCL P0.11)
* - No 32.768 kHz crystal fitted — see the K32SRC_RC note in board.conf
* - 3V3 enable on P0.13 (must be HIGH for SX1262 to function)
*/
@@ -30,6 +33,7 @@
zephyr,code-partition = &code_partition;
zephyr,console = &cdc_acm_uart;
zephyr,shell-uart = &cdc_acm_uart;
zephyr,display = &ssd1306;
};
aliases {
@@ -170,6 +174,21 @@
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
/* SSD1306 OLED — optional; absent panels fail device_is_ready() and are skipped */
ssd1306: ssd1306@3c {
compatible = "solomon,ssd1306";
reg = <0x3c>;
width = <128>;
height = <64>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
segment-remap;
com-invdir;
prechargep = <0x22>;
};
/* All supported environment & power sensors — auto-detected at runtime */
#include "../../common/sensors-i2c.dtsi"
};