Added Heltec V4.3 support/FEM autodetection

This commit is contained in:
2026-04-08 22:00:43 +03:00
parent 2997cc34dd
commit 4900bd4d1e
9 changed files with 130 additions and 235 deletions

View File

@@ -373,10 +373,10 @@
const int pin_miso = 19; const int pin_miso = 19;
const int pin_mosi = 23; const int pin_mosi = 23;
const int pin_busy = 32; const int pin_busy = 32;
const int pin_reset = 34; const int pin_reset = 25;
const int pin_dio = 33; const int pin_dio = 33;
const int pin_txen = -1; const int pin_txen = 16;
const int pin_rxen = -1; const int pin_rxen = 17;
const int pin_tcxo_enable = -1; const int pin_tcxo_enable = -1;
const int pin_btn_usr1 = 39; const int pin_btn_usr1 = 39;
@@ -555,7 +555,7 @@
#define HAS_LORA_LNA true #define HAS_LORA_LNA true
#define PIN_WAKEUP GPIO_NUM_0 #define PIN_WAKEUP GPIO_NUM_0
#define WAKEUP_LEVEL 0 #define WAKEUP_LEVEL 0
#define OCP_TUNED 0x18 #define OCP_TUNED 0x38
#define Vext GPIO_NUM_36 #define Vext GPIO_NUM_36
const int pin_btn_usr1 = 0; const int pin_btn_usr1 = 0;
@@ -579,13 +579,18 @@
#define LORA_LNA_GAIN 17 #define LORA_LNA_GAIN 17
#define LORA_LNA_GVT 12 #define LORA_LNA_GVT 12
#define LORA_PA_GC1109 true #define LORA_PA_GC1109 true
#define LORA_PA_AUTO_DETECT true
#define LORA_PA_PWR_EN 7 #define LORA_PA_PWR_EN 7
#define LORA_PA_CSD 2
#define LORA_PA_CPS 46
#define PA_MAX_OUTPUT 28 #define LORA_PA_CSD 2 // GC1109: PA_EN | KCT8103L: CSD (same pin, different pull resistor)
#define PA_GAIN_POINTS 22 #define LORA_PA_CTX 5 // KCT8103L: TX/LNA select (CTX=LOW=LNA, CTX=HIGH=PA)
#define PA_GAIN_VALUES 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7 #define LORA_PA_CPS 46 // GC1109: TX_EN
#define PA_MAX_OUTPUT 28
#define PA_GAIN_POINTS 22
#define PA_GC1109_GAIN_VALUES 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7
#define PA_KCT8103L_GAIN_VALUES 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 11, 10, 9, 8, 7
#define PA_GAIN_VALUES PA_KCT8103L_GAIN_VALUES // compile-time fallback; runtime detection selects correct table
const int pin_cs = 8; const int pin_cs = 8;
const int pin_busy = 13; const int pin_busy = 13;

View File

@@ -236,7 +236,7 @@
uint8_t display_addr = 0xFF; uint8_t display_addr = 0xFF;
volatile bool display_updating = false; volatile bool display_updating = false;
bool display_blanking_enabled = false; bool display_blanking_enabled = false;
bool display_diagnostics = true; bool display_diagnostics = true;
bool device_init_done = false; bool device_init_done = false;
bool eeprom_ok = false; bool eeprom_ok = false;
bool firmware_update_mode = false; bool firmware_update_mode = false;

View File

@@ -53,7 +53,7 @@
#elif BOARD_MODEL == BOARD_HELTEC32_V2 || BOARD_MODEL == BOARD_LORA32_V1_0 #elif BOARD_MODEL == BOARD_HELTEC32_V2 || BOARD_MODEL == BOARD_LORA32_V1_0
#define DISP_RST 16 #define DISP_RST 16
#define DISP_ADDR 0x3C #define DISP_ADDR 0x3C
#define OBSCL_OLED 15 #define SCL_OLED 15
#define SDA_OLED 4 #define SDA_OLED 4
#elif BOARD_MODEL == BOARD_HELTEC32_V3 #elif BOARD_MODEL == BOARD_HELTEC32_V3
#define DISP_RST 21 #define DISP_RST 21
@@ -73,7 +73,7 @@
#elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3
#define DISP_RST -1 #define DISP_RST -1
#define DISP_ADDR 0x3C #define DISP_ADDR 0x3C
#define SCL_OLED 44 #define SCL_OLED 0
#define SDA_OLED 42 #define SDA_OLED 42
#elif BOARD_MODEL == BOARD_MESHADVENTURER #elif BOARD_MODEL == BOARD_MESHADVENTURER
#define DISP_RST -1 #define DISP_RST -1

112
Makefile
View File

@@ -76,29 +76,29 @@ check_bt_buffers:
firmware: firmware:
arduino-cli compile --log --fqbn unsignedio:avr:rnode arduino-cli compile --log --fqbn unsignedio:avr:rnode
firmware-mega2560: firmware-aethernode: check_bt_buffers
arduino-cli compile --log --fqbn arduino:avr:mega arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-tbeam: check_bt_buffers firmware-diy_v1: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\"" arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF6\""
firmware-tbeam_sx126x: check_bt_buffers firmware-featheresp32: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\"" arduino-cli compile --log --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\""
firmware-t3s3: firmware-heltec32_v2: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x03\"" arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\""
firmware-t3s3_sx127x: firmware-heltec32_v2_extled: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x01\"" arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DEXTERNAL_LEDS=true\""
firmware-t3s3_sx1280_pa: firmware-heltec32_v3:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x04\"" arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3A\""
firmware-tdeck: firmware-heltec32_v4:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3B\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3F\""
firmware-tbeam_supreme: firmware-heltec_t114:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=-DBOARD_MODEL=0x3D" arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3C\""
firmware-lora32_v10: check_bt_buffers firmware-lora32_v10: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
@@ -118,17 +118,14 @@ firmware-lora32_v21_extled: check_bt_buffers
firmware-lora32_v21_tcxo: check_bt_buffers firmware-lora32_v21_tcxo: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DENABLE_TCXO=true\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x37\" \"-DENABLE_TCXO=true\""
firmware-heltec32_v2: check_bt_buffers firmware-meshadventurer: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\"" arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF4\""
firmware-heltec32_v2_extled: check_bt_buffers firmware-meshadventurer_s3: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V2 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DEXTERNAL_LEDS=true\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
firmware-heltec32_v3: firmware-meshadventurer_s3_nocdc: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:heltec_wifi_lora_32_V3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3A\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
firmware-heltec32_v4:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3F\""
firmware-rnode_ng_20: check_bt_buffers firmware-rnode_ng_20: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x40\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x40\""
@@ -136,32 +133,32 @@ firmware-rnode_ng_20: check_bt_buffers
firmware-rnode_ng_21: check_bt_buffers firmware-rnode_ng_21: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x41\"" arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x41\""
firmware-featheresp32: check_bt_buffers firmware-promicro:
arduino-cli compile --log --fqbn esp32:esp32:featheresp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x34\"" arduino-cli compile --log --fqbn promicro:nrf52:nicenanov2:softdevice=s140v6 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF5\""
firmware-genericesp32: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-meshadventurer_s3: check_bt_buffers
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\""
firmware-meshadventurer: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF4\""
firmware-diy_v1: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF6\""
firmware-aethernode: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-rak4631: firmware-rak4631:
arduino-cli compile --log --fqbn rakwireless:nrf52:WisCoreRAK4631Board -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x51\"" arduino-cli compile --log --fqbn rakwireless:nrf52:WisCoreRAK4631Board -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x51\""
firmware-heltec_t114: firmware-t3s3:
arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3C\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x03\""
firmware-promicro: firmware-t3s3_sx127x:
arduino-cli compile --log --fqbn promicro:nrf52:nicenanov2:softdevice=s140v6 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF5\"" arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x01\""
firmware-t3s3_sx1280_pa:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x42\" \"-DMODEM=0x04\""
firmware-tbeam: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\""
firmware-tbeam_supreme:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=-DBOARD_MODEL=0x3D"
firmware-tbeam_sx126x: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\" \"-DMODEM=0x03\""
firmware-tdeck:
arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3B\""
firmware-techo: firmware-techo:
arduino-cli compile --log --fqbn adafruit:nrf52:pca10056 -e --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\"" arduino-cli compile --log --fqbn adafruit:nrf52:pca10056 -e --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x44\""
@@ -169,6 +166,12 @@ firmware-techo:
firmware-xiao_s3: firmware-xiao_s3:
arduino-cli compile --log --fqbn "esp32:esp32:XIAO_ESP32S3" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3E\"" arduino-cli compile --log --fqbn "esp32:esp32:XIAO_ESP32S3" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3E\""
firmware-genericesp32: check_bt_buffers
arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\""
firmware-mega2560:
arduino-cli compile --log --fqbn arduino:avr:mega
upload: upload:
arduino-cli upload -p /dev/ttyUSB0 --fqbn unsignedio:avr:rnode arduino-cli upload -p /dev/ttyUSB0 --fqbn unsignedio:avr:rnode
@@ -184,7 +187,14 @@ upload-meshadventurer_s3:
# @sleep 1 # @sleep 1
# rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) # rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-meshadventurer_s3_usb:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32s3
# @sleep 1
# rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3
python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-meshadventurer: upload-meshadventurer:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32 arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:esp32
@@ -257,28 +267,28 @@ upload-heltec32_v3:
@sleep 1 @sleep 1
rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-heltec32_v4: upload-heltec32_v4:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-tdeck: upload-tdeck:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-tbeam_supreme: upload-tbeam_supreme:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin)
@sleep 3 @sleep 3
python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
upload-rnode_ng_20: upload-rnode_ng_20:
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32 arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32

View File

@@ -1781,7 +1781,13 @@ void sleep_now() {
#endif #endif
#endif #endif
#if BOARD_MODEL == BOARD_HELTEC32_V4 #if BOARD_MODEL == BOARD_HELTEC32_V4
digitalWrite(LORA_PA_CPS, LOW); #if LORA_PA_AUTO_DETECT
if (sx126x_modem.isKCT8103L()) {
digitalWrite(LORA_PA_CTX, LOW);
} else {
digitalWrite(LORA_PA_CPS, LOW);
}
#endif
digitalWrite(LORA_PA_CSD, LOW); digitalWrite(LORA_PA_CSD, LOW);
digitalWrite(LORA_PA_PWR_EN, LOW); digitalWrite(LORA_PA_PWR_EN, LOW);
digitalWrite(Vext, HIGH); digitalWrite(Vext, HIGH);

View File

@@ -1322,7 +1322,13 @@ int getTxPower() {
} }
#if HAS_LORA_PA #if HAS_LORA_PA
const int tx_gain[PA_GAIN_POINTS] = {PA_GAIN_VALUES}; #if LORA_PA_AUTO_DETECT
static const int gc1109_tx_gain[PA_GAIN_POINTS] = {PA_GC1109_GAIN_VALUES};
static const int kct8103l_tx_gain[PA_GAIN_POINTS] = {PA_KCT8103L_GAIN_VALUES};
const int* tx_gain = sx126x_modem.isKCT8103L() ? kct8103l_tx_gain : gc1109_tx_gain;
#else
const int tx_gain[PA_GAIN_POINTS] = {PA_GAIN_VALUES};
#endif
#endif #endif
int map_target_power_to_modem_output(int target_tx_power) { int map_target_power_to_modem_output(int target_tx_power) {

View File

@@ -1,133 +0,0 @@
diff --git a/Display.h b/Display.h
index 7d903b9..882af8d 100644
--- a/Display.h
+++ b/Display.h
@@ -1071,6 +1071,7 @@ void update_display(bool blank = false) {
#if BOARD_MODEL == BOARD_HELTEC_T114
display.clear();
display.display();
+ digitalWrite(PIN_T114_TFT_BLGT, HIGH);
#elif BOARD_MODEL != BOARD_TDECK && BOARD_MODEL != BOARD_TECHO
display.clearDisplay();
display.display();
@@ -1128,6 +1129,9 @@ void update_display(bool blank = false) {
void display_unblank() {
last_unblank_event = millis();
+ #if BOARD_MODEL == BOARD_HELTEC_T114
+ digitalWrite(PIN_T114_TFT_BLGT, LOW);
+ #endif
}
void ext_fb_enable() {
diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino
index 5649206..ba157e6 100644
--- a/RNode_Firmware.ino
+++ b/RNode_Firmware.ino
@@ -535,7 +535,9 @@ bool startRadio() {
// Flash an info pattern to indicate
// that the radio is now on
kiss_indicate_radiostate();
- led_indicate_info(3);
+ if (!display_blanked) {
+ led_indicate_info(3);
+ }
return true;
}
@@ -575,7 +577,7 @@ volatile bool queue_flushing = false;
void flush_queue(void) {
if (!queue_flushing) {
queue_flushing = true;
- led_tx_on();
+ if (!display_blanked) { led_tx_on(); }
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
while (!fifo16_isempty(&packet_starts)) {
@@ -596,7 +598,7 @@ void flush_queue(void) {
}
}
- lora_receive(); led_tx_off();
+ lora_receive(); if (!display_blanked) { led_tx_off(); }
}
queue_height = 0;
@@ -615,7 +617,8 @@ void flush_queue(void) {
void pop_queue() {
if (!queue_flushing) {
- queue_flushing = true; led_tx_on();
+ queue_flushing = true;
+ if (!display_blanked) { led_tx_on(); }
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
if (!fifo16_isempty(&packet_starts)) {
@@ -637,7 +640,8 @@ void pop_queue() {
queued_bytes -= length;
}
- lora_receive(); led_tx_off();
+ lora_receive();
+ if (!display_blanked) { led_tx_off(); }
}
#if MCU_VARIANT == MCU_ESP32 || MCU_VARIANT == MCU_NRF52
@@ -751,7 +755,7 @@ void transmit(uint16_t size) {
add_airtime(written);
} else {
- led_tx_on(); uint16_t written = 0;
+ if (!display_blanked) { led_tx_on(); } uint16_t written = 0;
if (size > SINGLE_MTU) { size = SINGLE_MTU; }
if (!implicit) { LoRa->beginPacket(); }
else { LoRa->beginPacket(size); }
@@ -984,7 +988,7 @@ void serial_callback(uint8_t sbyte) {
} else if (command == CMD_RADIO_LOCK) {
update_radio_lock();
kiss_indicate_radio_lock();
- } else if (command == CMD_BLINK) {
+ } else if (command == CMD_BLINK && !display_blanked) {
led_indicate_info(sbyte);
} else if (command == CMD_RANDOM) {
kiss_indicate_random(getRandom());
@@ -1431,13 +1435,15 @@ void update_modem_status() {
if (carrier_detected) { dcd = true; } else { dcd = false; }
dcd_led = dcd;
- if (dcd_led) { led_rx_on(); }
+ if (!display_blanked && dcd_led) { led_rx_on(); }
else {
if (interference_detected) {
- if (led_id_filter >= LED_ID_TRIG && noise_floor_sampled) { led_id_on(); }
+ if (led_id_filter >= LED_ID_TRIG && noise_floor_sampled && !display_blanked) { led_id_on(); }
} else {
- if (airtime_lock) { led_indicate_airtime_lock(); }
- else { led_rx_off(); led_id_off(); }
+ if (airtime_lock && !display_blanked) { led_indicate_airtime_lock(); }
+ else {
+ if (!display_blanked) { led_rx_off(); led_id_off(); }
+ }
}
}
}
@@ -1707,7 +1713,9 @@ void loop() {
console_loop();
#endif
} else {
- led_indicate_standby();
+ if (!display_blanked) {
+ led_indicate_standby();
+ }
}
} else {
diff --git a/arduino-cli.yaml b/arduino-cli.yaml
index 6dd5f8d..d358070 100644
--- a/arduino-cli.yaml
+++ b/arduino-cli.yaml
@@ -4,4 +4,3 @@ board_manager:
- https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json
- https://github.com/HelTecAutomation/Heltec_nRF52/releases/download/1.7.0/package_heltec_nrf_index.json
- https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- - http://unsigned.io/arduino/package_unsignedio_UnsignedBoards_index.json

View File

@@ -363,7 +363,9 @@ int sx126x::begin(long frequency) {
setFrequency(frequency); setFrequency(frequency);
setTxPower(2); setTxPower(2);
enableCrc(); enableCrc();
writeRegister(REG_LNA_6X, 0x96); // Set LNA boost writeRegister(REG_LNA_6X, 0x96); // Set LNA boosted gain mode
// Undocumented SX1262 register patch recommended by Heltec/Semtech for improved RX sensitivity.
writeRegister(0x08B5, readRegister(0x08B5) | 0x01);
uint8_t basebuf[2] = {0}; // Set base addresses uint8_t basebuf[2] = {0}; // Set base addresses
executeOpcode(OP_BUFFER_BASE_ADDR_6X, basebuf, 2); executeOpcode(OP_BUFFER_BASE_ADDR_6X, basebuf, 2);
@@ -371,31 +373,29 @@ int sx126x::begin(long frequency) {
setPacketParams(_preambleLength, _implicitHeaderMode, _payloadLength, _crcMode); setPacketParams(_preambleLength, _implicitHeaderMode, _payloadLength, _crcMode);
#if HAS_LORA_PA #if HAS_LORA_PA
#if LORA_PA_GC1109 #if LORA_PA_AUTO_DETECT
// Enable Vfem_ctl for supply to // Power up the FEM, then read GPIO LORA_PA_CSD as input.
// PA power net. // The V4.2 (GC1109) board pulls it LOW; V4.3 (KCT8103L) pulls it HIGH.
pinMode(LORA_PA_PWR_EN, OUTPUT); pinMode(LORA_PA_PWR_EN, OUTPUT);
digitalWrite(LORA_PA_PWR_EN, HIGH); digitalWrite(LORA_PA_PWR_EN, HIGH);
delay(1);
pinMode(LORA_PA_CSD, INPUT);
delay(1);
_kct8103l = (digitalRead(LORA_PA_CSD) == HIGH);
// Enable PA LNA and TX standby if (_kct8103l) {
pinMode(LORA_PA_CSD, OUTPUT); // KCT8103L (V4.3): CSD=HIGH enables chip, CTX=LOW=LNA/RX, CTX=HIGH=PA/TX
digitalWrite(LORA_PA_CSD, HIGH); pinMode(LORA_PA_CSD, OUTPUT);
digitalWrite(LORA_PA_CSD, HIGH);
// Keep PA CPS low until actual pinMode(LORA_PA_CTX, OUTPUT);
// transmit. Does it save power? digitalWrite(LORA_PA_CTX, LOW); // LNA enabled by default
// Who knows? Will have to measure. } else {
// Note from the future: Nope. // GC1109 (V4.2): PA_EN=HIGH enables chip, CPS=HIGH=full PA mode
// Power consumption is the same, pinMode(LORA_PA_CSD, OUTPUT);
// and turning it on and off is digitalWrite(LORA_PA_CSD, HIGH);
// not something that it likes. pinMode(LORA_PA_CPS, OUTPUT);
// Keeping it high for now. digitalWrite(LORA_PA_CPS, HIGH);
pinMode(LORA_PA_CPS, OUTPUT); }
digitalWrite(LORA_PA_CPS, HIGH);
// On Heltec V4, the PA CTX pin
// is driven by the SX1262 DIO2
// pin directly, so we do not
// need to manually raise this.
#endif #endif
#endif #endif
@@ -406,12 +406,12 @@ void sx126x::end() { sleep(); SPI.end(); _preinit_done = false; }
int sx126x::beginPacket(int implicitHeader) { int sx126x::beginPacket(int implicitHeader) {
#if HAS_LORA_PA #if HAS_LORA_PA
#if LORA_PA_GC1109 #if LORA_PA_AUTO_DETECT
// Enable PA CPS for transmit if (_kct8103l) {
// digitalWrite(LORA_PA_CPS, HIGH); // CTX=HIGH: switch KCT8103L to PA/TX mode.
// Disabled since we're keeping it digitalWrite(LORA_PA_CTX, HIGH);
// on permanently as long as the }
// radio is powered up. // GC1109: CPS kept HIGH permanently, no action needed.
#endif #endif
#endif #endif
@@ -628,14 +628,12 @@ void sx126x::onReceive(void(*callback)(int)){
void sx126x::receive(int size) { void sx126x::receive(int size) {
#if HAS_LORA_PA #if HAS_LORA_PA
#if LORA_PA_GC1109 #if LORA_PA_AUTO_DETECT
// Disable PA CPS for receive if (_kct8103l) {
// digitalWrite(LORA_PA_CPS, LOW); // CTX=LOW: switch KCT8103L to LNA/RX mode.
// That turned out to be a bad idea. digitalWrite(LORA_PA_CTX, LOW);
// The LNA goes wonky if it's toggled }
// on and off too quickly. We'll keep // GC1109: CPS kept HIGH permanently, no action needed.
// it on permanently, as long as the
// radio is powered up.
#endif #endif
#endif #endif

View File

@@ -98,6 +98,8 @@ public:
void dumpRegisters(Stream& out); void dumpRegisters(Stream& out);
bool isKCT8103L() { return _kct8103l; }
private: private:
void explicitHeaderMode(); void explicitHeaderMode();
void implicitHeaderMode(); void implicitHeaderMode();
@@ -139,6 +141,7 @@ private:
int _fifo_rx_addr_ptr; int _fifo_rx_addr_ptr;
uint8_t _packet[255]; uint8_t _packet[255];
bool _preinit_done; bool _preinit_done;
bool _kct8103l;
void (*_onReceive)(int); void (*_onReceive)(int);
}; };