From 9008c755176b9e11da22816ca0e5fa2dac2a0d9c Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:45:10 +0100 Subject: [PATCH] Fixed: Tlora-t3s3-v1 SX1262 firmware reboots continuously (#2308) (#2315) --- boards/tlora-t3s3-v1.json | 2 +- platformio.ini | 1 + src/main.cpp | 26 +++++++++++++------------- variants/tlora_t3s3_v1/platformio.ini | 1 + variants/tlora_t3s3_v1/variant.h | 9 +++++---- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/boards/tlora-t3s3-v1.json b/boards/tlora-t3s3-v1.json index 5af53084fc..d073fc7c1b 100644 --- a/boards/tlora-t3s3-v1.json +++ b/boards/tlora-t3s3-v1.json @@ -14,7 +14,7 @@ "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "dio", - "hwids": [["0X303A", "0x1001"]], + "hwids": [["0x303A", "0x1001"]], "mcu": "esp32s3", "variant": "tlora-t3s3-v1" }, diff --git a/platformio.ini b/platformio.ini index 4f8f53d0c9..af18a6f8b3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,6 +13,7 @@ default_envs = tbeam ;default_envs = tlora_v1_3 ;default_envs = tlora-v2 ;default_envs = tlora-v2-1-1.6 +;default_envs = tlora-t3s3-v1 ;default_envs = lora-relay-v1 # nrf board ;default_envs = t-echo ;default_envs = nrf52840dk-geeksville diff --git a/src/main.cpp b/src/main.cpp index e2e39ebd26..c1afb5c18c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -420,19 +420,6 @@ void setup() } #endif -#if defined(USE_SX1280) - if (!rIf) { - rIf = new SX1280Interface(SX128X_CS, SX128X_DIO1, SX128X_RESET, SX128X_BUSY, SPI); - if (!rIf->init()) { - LOG_WARN("Failed to find SX1280 radio\n"); - delete rIf; - rIf = NULL; - } else { - LOG_INFO("SX1280 Radio init succeeded, using SX1280 radio\n"); - } - } -#endif - #if defined(USE_SX1262) if (!rIf) { rIf = new SX1262Interface(SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY, SPI); @@ -472,6 +459,19 @@ void setup() } #endif +#if defined(USE_SX1280) + if (!rIf) { + rIf = new SX1280Interface(SX128X_CS, SX128X_DIO1, SX128X_RESET, SX128X_BUSY, SPI); + if (!rIf->init()) { + LOG_WARN("Failed to find SX1280 radio\n"); + delete rIf; + rIf = NULL; + } else { + LOG_INFO("SX1280 Radio init succeeded, using SX1280 radio\n"); + } + } +#endif + // check if the radio chip matches the selected region if ((config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (!rIf->wideLora())) { diff --git a/variants/tlora_t3s3_v1/platformio.ini b/variants/tlora_t3s3_v1/platformio.ini index aa81891994..568e8af420 100644 --- a/variants/tlora_t3s3_v1/platformio.ini +++ b/variants/tlora_t3s3_v1/platformio.ini @@ -1,6 +1,7 @@ [env:tlora-t3s3-v1] extends = esp32s3_base board = tlora-t3s3-v1 +upload_protocol = esp-builtin lib_deps = ${esp32_base.lib_deps} caveman99/ESP32 Codec2@^1.0.1 diff --git a/variants/tlora_t3s3_v1/variant.h b/variants/tlora_t3s3_v1/variant.h index 116911ae07..68eb18e312 100644 --- a/variants/tlora_t3s3_v1/variant.h +++ b/variants/tlora_t3s3_v1/variant.h @@ -37,11 +37,12 @@ #ifdef USE_SX1262 #define SX126X_CS RF95_NSS // FIXME - we really should define LORA_CS instead -#define SX126X_DIO1 LORA_DIO1 -#define SX126X_BUSY 36 +#define SX126X_DIO1 33 +#define SX126X_BUSY 34 #define SX126X_RESET LORA_RESET -#define SX126X_RXEN 21 -#define SX126X_TXEN 10 +//#define SX126X_RXEN 21 +//#define SX126X_TXEN 10 +#define SX126X_E22 #endif #ifdef USE_SX1280