From 28b1586fd737533f0d8da46561791e406f34c0d3 Mon Sep 17 00:00:00 2001 From: me Date: Mon, 20 Apr 2026 20:45:04 -0700 Subject: [PATCH] feat(techo-lite): add Non-Shell (screenless) companion BLE variant T-Echo Lite Non-Shell has no ePaper display, but the existing companion BLE env inherits DISPLAY_CLASS=GxEPDDisplay from the base env. This causes display.begin() to run on non-existent hardware, corrupting BLE initialization and generating a random PIN that cannot be displayed, making BLE connection impossible. Add LilyGo_T-Echo-Lite_non_shell_companion_radio_ble env that: - excludes DISPLAY_CLASS and ePaper-related build flags - removes GxEPDDisplay.cpp and ui-new from build sources - uses static BLE_PIN_CODE=123456 (avoids random PIN generation) Also fix boards/t-echo.json: - add nrfutil to upload protocols list - add use_1200bps_touch=true and wait_for_upload_port=true to enable reliable flashing via PlatformIO upload button --- boards/t-echo.json | 7 ++-- variants/lilygo_techo_lite/platformio.ini | 44 +++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/boards/t-echo.json b/boards/t-echo.json index c974ca65..e0df6eac 100644 --- a/boards/t-echo.json +++ b/boards/t-echo.json @@ -53,11 +53,14 @@ "protocols": [ "jlink", "nrfjprog", + "nrfutil", "stlink", "cmsis-dap", "blackmagic" - ] + ], + "use_1200bps_touch": true, + "wait_for_upload_port": true }, "url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/", "vendor": "Nordic" -} \ No newline at end of file +} diff --git a/variants/lilygo_techo_lite/platformio.ini b/variants/lilygo_techo_lite/platformio.ini index 0ba6a197..88616858 100644 --- a/variants/lilygo_techo_lite/platformio.ini +++ b/variants/lilygo_techo_lite/platformio.ini @@ -96,3 +96,47 @@ build_src_filter = ${LilyGo_T-Echo-Lite.build_src_filter} lib_deps = ${LilyGo_T-Echo-Lite.lib_deps} densaugeo/base64 @ ~1.4.0 + +[env:LilyGo_T-Echo-Lite_non_shell_companion_radio_ble] +extends = LilyGo_T-Echo-Lite +upload_protocol = nrfutil +board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld +board_upload.maximum_size = 712704 +build_flags = + ${nrf52_base.build_flags} + -I variants/lilygo_techo_lite + -I src/helpers/nrf52 + -I lib/nrf52/s140_nrf52_6.1.1_API/include + -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 + -I src/helpers/ui + -I examples/companion_radio/ui-new + -D LILYGO_TECHO + -D RADIO_CLASS=CustomSX1262 + -D WRAPPER_CLASS=CustomSX1262Wrapper + -D LORA_TX_POWER=22 + -D SX126X_POWER_EN=30 + -D SX126X_CURRENT_LIMIT=140 + -D SX126X_RX_BOOSTED_GAIN=1 + -D P_LORA_TX_LED=LED_GREEN + -D DISABLE_DIAGNOSTIC_OUTPUT + -D ENV_INCLUDE_GPS=1 + -D GPS_BAUD_RATE=9600 + -D PIN_GPS_EN=GPS_EN + -D AUTO_OFF_MILLIS=0 + -D MAX_CONTACTS=350 + -D MAX_GROUP_CHANNELS=40 + -D BLE_PIN_CODE=123456 + -D OFFLINE_QUEUE_SIZE=256 + -D UI_RECENT_LIST_SIZE=9 + -D AUTO_SHUTDOWN_MILLIVOLTS=3300 +build_src_filter = ${nrf52_base.build_src_filter} + + + + + + + + + +<../variants/lilygo_techo_lite> + + + +<../examples/companion_radio/*.cpp> +lib_deps = + ${LilyGo_T-Echo-Lite.lib_deps} + densaugeo/base64 @ ~1.4.0