From 35e9f36ffde2e7072d2d66eb283a3b3d5a55efb4 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 9 Jul 2024 09:40:30 +0100 Subject: [PATCH 1/8] Add T3S3 target and different variants of the board --- Boards.h | 25 +++++++++++++++++++++---- Display.h | 4 ++-- Makefile | 7 +++++-- RNode_Firmware_CE.ino | 4 ++-- Radio.cpp | 2 +- Utilities.h | 8 ++++---- 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/Boards.h b/Boards.h index 3d0a80c..2165509 100644 --- a/Boards.h +++ b/Boards.h @@ -24,6 +24,7 @@ #define MCU_ESP32 0x81 #define MCU_NRF52 0x71 + // Boards #define BOARD_RNODE 0x31 #define BOARD_HMBRW 0x32 #define BOARD_TBEAM 0x33 @@ -36,10 +37,16 @@ #define BOARD_HELTEC32_V3 0x3A #define BOARD_RNODE_NG_20 0x40 #define BOARD_RNODE_NG_21 0x41 - #define BOARD_RNODE_NG_22 0x42 + #define BOARD_T3S3 0x42 #define BOARD_GENERIC_NRF52 0x50 #define BOARD_RAK4631 0x51 + // Variants + #define BOARD_T3S3_SX1262 0x01 + #define BOARD_T3S3_SX1280 0x02 + #define BOARD_T3S3_SX1280_PA 0x03 + + // Displays #define OLED 0x01 #define EINK_BW 0x02 #define EINK_3C 0x03 @@ -545,7 +552,7 @@ } }; - #elif BOARD_MODEL == BOARD_RNODE_NG_22 + #elif BOARD_MODEL == BOARD_T3S3 #define IS_ESP32S3 true #define HAS_DISPLAY true @@ -585,7 +592,7 @@ #endif #endif - + #if BOARD_VARIANT == BOARD_T3S3_SX1262 const uint8_t interfaces[INTERFACE_COUNT] = {SX1262}; const bool interface_cfg[INTERFACE_COUNT][3] = { // SX1262 @@ -595,6 +602,17 @@ true // DIO2_AS_RF_SWITCH }, }; + #elif BOARD_VARIANT == BOARD_T3S3_SX1280_PA + const uint8_t interfaces[INTERFACE_COUNT] = {SX1280}; + const bool interface_cfg[INTERFACE_COUNT][3] = { + // SX1262 + { + false, // DEFAULT_SPI + false, // HAS_TCXO + false // DIO2_AS_RF_SWITCH + }, + }; + #endif const uint8_t interface_pins[INTERFACE_COUNT][10] = { // SX1262 { @@ -610,7 +628,6 @@ -1 // pin_tcxo_enable } }; - #else #error An unsupported ESP32 board was selected. Cannot compile RNode firmware. #endif diff --git a/Display.h b/Display.h index cd1a59e..86f5055 100644 --- a/Display.h +++ b/Display.h @@ -68,7 +68,7 @@ void busyCallback(const void* p) { #define DISP_RST -1 #define DISP_ADDR 0x3C #endif -#elif BOARD_MODEL == BOARD_RNODE_NG_22 +#elif BOARD_MODEL == BOARD_T3S3 #if DISPLAY == OLED #define DISP_RST 21 #define DISP_ADDR 0x3C @@ -200,7 +200,7 @@ bool display_init() { digitalWrite(pin_display_en, LOW); delay(50); digitalWrite(pin_display_en, HIGH); - #elif BOARD_MODEL == BOARD_RNODE_NG_22 + #elif BOARD_MODEL == BOARD_T3S3 Wire.begin(SDA_OLED, SCL_OLED); #elif BOARD_MODEL == BOARD_HELTEC32_V2 Wire.begin(SDA_OLED, SCL_OLED); diff --git a/Makefile b/Makefile index 37b74ba..5cd0180 100644 --- a/Makefile +++ b/Makefile @@ -71,8 +71,11 @@ firmware-tbeam: firmware-tbeam_sx126x: arduino-cli compile --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-t3s3: - arduino-cli compile --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\"" +firmware-t3s3_sx1262: + arduino-cli compile --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\" \"-DBOARD_VARIANT=0x01\"" + +firmware-t3s3_sx1280_pa: + arduino-cli compile --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\" \"-DBOARD_VARIANT=0x03\"" firmware-lora32_v10: arduino-cli compile --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\"" diff --git a/RNode_Firmware_CE.ino b/RNode_Firmware_CE.ino index 5686ac7..18f9e1d 100644 --- a/RNode_Firmware_CE.ino +++ b/RNode_Firmware_CE.ino @@ -87,7 +87,7 @@ void setup() { Serial.begin(serial_baudrate); - #if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_RNODE_NG_22 + #if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_T3S3 // Some boards need to wait until the hardware UART is set up before booting // the full firmware. In the case of the RAK4631, the line below will wait // until a serial connection is actually established with a master. Thus, it @@ -1283,7 +1283,7 @@ void process_serial() { void sleep_now() { #if HAS_SLEEP == true - #if BOARD_MODEL == BOARD_RNODE_NG_22 + #if BOARD_MODEL == BOARD_T3S3 display_intensity = 0; update_display(true); #endif diff --git a/Radio.cpp b/Radio.cpp index 33b46a9..f1edfad 100644 --- a/Radio.cpp +++ b/Radio.cpp @@ -735,7 +735,7 @@ void sx126x::enableTCXO() { uint8_t buf[4] = {MODE_TCXO_3_3V_6X, 0x00, 0x00, 0xFF}; #elif BOARD_MODEL == BOARD_TBEAM uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; - #elif BOARD_MODEL == BOARD_RNODE_NG_22 + #elif BOARD_MODEL == BOARD_T3S3 uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; #else uint8_t buf[4] = {0}; diff --git a/Utilities.h b/Utilities.h index bd55d4a..407fb18 100644 --- a/Utilities.h +++ b/Utilities.h @@ -65,9 +65,9 @@ uint8_t eeprom_read(uint32_t mapped_addr); #if BOARD_MODEL == BOARD_HELTEC32_V3 //https://github.com/espressif/esp-idf/issues/8855 #include "hal/wdt_hal.h" - #elif BOARD_MODEL == BOARD_RNODE_NG_22 + #elif BOARD_MODEL == BOARD_T3S3 #include "hal/wdt_hal.h" - #else BOARD_MODEL != BOARD_RNODE_NG_22 + #else BOARD_MODEL != BOARD_T3S3 #include "soc/rtc_wdt.h" #endif #define ISR_VECT IRAM_ATTR @@ -137,7 +137,7 @@ uint8_t boot_vector = 0x00; void led_rx_off() { digitalWrite(pin_led_rx, LOW); } void led_tx_on() { digitalWrite(pin_led_tx, HIGH); } void led_tx_off() { digitalWrite(pin_led_tx, LOW); } - #elif BOARD_MODEL == BOARD_RNODE_NG_22 + #elif BOARD_MODEL == BOARD_T3S3 void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } void led_rx_off() { digitalWrite(pin_led_rx, LOW); } void led_tx_on() { digitalWrite(pin_led_tx, HIGH); } @@ -1332,7 +1332,7 @@ bool eeprom_model_valid() { if (model == MODEL_A3 || model == MODEL_A8) { #elif BOARD_MODEL == BOARD_RNODE_NG_21 if (model == MODEL_A2 || model == MODEL_A7) { - #elif BOARD_MODEL == BOARD_RNODE_NG_22 + #elif BOARD_MODEL == BOARD_T3S3 if (model == MODEL_A1 || model == MODEL_A6) { #elif BOARD_MODEL == BOARD_HMBRW if (model == MODEL_FF || model == MODEL_FE) { From 63eab05014f7c391066e89df0708f9a50ccb2650 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 9 Jul 2024 09:41:14 +0100 Subject: [PATCH 2/8] Add clarification for interface_spi --- Boards.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Boards.h b/Boards.h index 2165509..45650e3 100644 --- a/Boards.h +++ b/Boards.h @@ -706,6 +706,7 @@ #endif #ifndef INTERFACE_SPI + // INTERFACE_SPI is only required on NRF52 platforms, as the SPI pins are set in the class constructor and not by a setter method. // Even if custom SPI interfaces are not needed, the array must exist to prevent compilation errors. #define INTERFACE_SPI const SPIClass interface_spi[1]; From ba2d36add9eef89da05238c3b436a5b68a53fe5b Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 9 Jul 2024 10:37:50 +0100 Subject: [PATCH 3/8] Switch from board variant being set separately to using model number instead. --- Boards.h | 12 ++-- Makefile | 4 +- ROM.h | 2 + Radio.cpp | 163 +++++++++++++++++++++++++++++++++++++++------------- Utilities.h | 3 +- 5 files changed, 132 insertions(+), 52 deletions(-) diff --git a/Boards.h b/Boards.h index 45650e3..a3512fb 100644 --- a/Boards.h +++ b/Boards.h @@ -14,6 +14,7 @@ // along with this program. If not, see . #include "Interfaces.h" +#include "ROM.h" #ifndef BOARDS_H #define BOARDS_H @@ -41,11 +42,6 @@ #define BOARD_GENERIC_NRF52 0x50 #define BOARD_RAK4631 0x51 - // Variants - #define BOARD_T3S3_SX1262 0x01 - #define BOARD_T3S3_SX1280 0x02 - #define BOARD_T3S3_SX1280_PA 0x03 - // Displays #define OLED 0x01 #define EINK_BW 0x02 @@ -592,7 +588,7 @@ #endif #endif - #if BOARD_VARIANT == BOARD_T3S3_SX1262 + #if BOARD_VARIANT == MODEL_A1 const uint8_t interfaces[INTERFACE_COUNT] = {SX1262}; const bool interface_cfg[INTERFACE_COUNT][3] = { // SX1262 @@ -602,10 +598,10 @@ true // DIO2_AS_RF_SWITCH }, }; - #elif BOARD_VARIANT == BOARD_T3S3_SX1280_PA + #elif BOARD_VARIANT == MODEL_A5 // SX1280 with PA const uint8_t interfaces[INTERFACE_COUNT] = {SX1280}; const bool interface_cfg[INTERFACE_COUNT][3] = { - // SX1262 + // SX1280 { false, // DEFAULT_SPI false, // HAS_TCXO diff --git a/Makefile b/Makefile index 5cd0180..f4712e0 100644 --- a/Makefile +++ b/Makefile @@ -72,10 +72,10 @@ firmware-tbeam_sx126x: arduino-cli compile --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-t3s3_sx1262: - arduino-cli compile --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\" \"-DBOARD_VARIANT=0x01\"" + arduino-cli compile --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\" \"-DBOARD_VARIANT=0xA1\"" firmware-t3s3_sx1280_pa: - arduino-cli compile --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\" \"-DBOARD_VARIANT=0x03\"" + arduino-cli compile --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\" \"-DBOARD_VARIANT=0xA5\"" firmware-lora32_v10: arduino-cli compile --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\"" diff --git a/ROM.h b/ROM.h index 7a343c0..c7bcc31 100644 --- a/ROM.h +++ b/ROM.h @@ -29,7 +29,9 @@ #define PRODUCT_RAK4631 0x10 #define MODEL_11 0x11 #define MODEL_12 0x12 + #define MODEL_13 0x13 // RAK4631 with WisBlock SX1280 module (LIBSYS002) #define MODEL_A1 0xA1 + #define MODEL_A5 0xA5 // T3S3 SX1280 PA #define MODEL_A6 0xA6 #define MODEL_A4 0xA4 #define MODEL_A9 0xA9 diff --git a/Radio.cpp b/Radio.cpp index f1edfad..57ae164 100644 --- a/Radio.cpp +++ b/Radio.cpp @@ -2192,11 +2192,118 @@ void sx128x::disableTCXO() { } void sx128x::setTxPower(int level, int outputPin) { - // PA calculation currently only works for the LoRa1280F27. Support for - // other assemblies would be appreciated in a PR. - if (outputPin == PA_OUTPUT_PA_BOOST_PIN) { - if (level > 27) { - level = 27; + uint8_t tx_buf[2]; + #if BOARD_VARIANT == MODEL_13 + // RAK4631 with WisBlock SX1280 module (LIBSYS002) + if (level > 27) { + level = 27; + } else if (level < 0) { + level = 0; + } + + _txp = level; + + int reg_value; + + switch (level) { + case 0: + reg_value = -18; + break; + case 1: + reg_value = -17; + break; + case 2: + reg_value = -16; + break; + case 3: + reg_value = -15; + break; + case 4: + reg_value = -14; + break; + case 5: + reg_value = -13; + break; + case 6: + reg_value = -12; + break; + case 7: + reg_value = -10; + break; + case 8: + reg_value = -9; + break; + case 9: + reg_value = -8; + break; + case 10: + reg_value = -7; + break; + case 11: + reg_value = -6; + break; + case 12: + reg_value = -5; + break; + case 13: + reg_value = -4; + break; + case 14: + reg_value = -3; + break; + case 15: + reg_value = -2; + break; + case 16: + reg_value = -1; + break; + case 17: + reg_value = 0; + break; + case 18: + reg_value = 1; + break; + case 19: + reg_value = 2; + break; + case 20: + reg_value = 3; + break; + case 21: + reg_value = 4; + break; + case 22: + reg_value = 5; + break; + case 23: + reg_value = 6; + break; + case 24: + reg_value = 8; + break; + case 25: + reg_value = 9; + break; + case 26: + reg_value = 12; + break; + case 27: + reg_value = 13; + break; + default: + reg_value = 0; + break; + } + + tx_buf[0] = reg_value; + tx_buf[1] = 0xE0; // ramping time - 20 microseconds + + executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2); + + #elif BOARD_VARIANT == MODEL_A5 + // T3S3 SX1280 PA + if (level > 20) { + level = 20; } else if (level < 0) { level = 0; } @@ -2206,7 +2313,7 @@ void sx128x::setTxPower(int level, int outputPin) { int reg_value; switch (level) { - case 0: + /*case 0: reg_value = -18; break; case 1: @@ -2265,57 +2372,31 @@ void sx128x::setTxPower(int level, int outputPin) { break; case 19: reg_value = 2; - break; + break;*/ case 20: reg_value = 3; break; - case 21: - reg_value = 4; - break; - case 22: - reg_value = 5; - break; - case 23: - reg_value = 6; - break; - case 24: - reg_value = 8; - break; - case 25: - reg_value = 9; - break; - case 26: - reg_value = 12; - break; - case 27: - reg_value = 13; + default: + reg_value = 0; break; } - - uint8_t tx_buf[2]; - - tx_buf[0] = reg_value; + tx_buf[0] = level; tx_buf[1] = 0xE0; // ramping time - 20 microseconds - - executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2); - } else { + #else + // For SX1280 boards with no specific PA requirements if (level > 13) { level = 13; } else if (level < -18) { level = -18; } + _txp = level; - level = level + 18; - - uint8_t tx_buf[2]; - tx_buf[0] = level; tx_buf[1] = 0xE0; // ramping time - 20 microseconds - - executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2); - } + #endif + executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2); } uint8_t sx128x::getTxPower() { diff --git a/Utilities.h b/Utilities.h index 407fb18..8125203 100644 --- a/Utilities.h +++ b/Utilities.h @@ -984,6 +984,7 @@ void setTXPower(RadioInterface* radio, int txp) { if (model == MODEL_A2) radio->setTxPower(txp, PA_OUTPUT_PA_BOOST_PIN); if (model == MODEL_A3) radio->setTxPower(txp, PA_OUTPUT_RFO_PIN); if (model == MODEL_A4) radio->setTxPower(txp, PA_OUTPUT_RFO_PIN); + if (model == MODEL_A5) radio->setTxPower(txp, PA_OUTPUT_RFO_PIN); if (model == MODEL_A6) radio->setTxPower(txp, PA_OUTPUT_PA_BOOST_PIN); if (model == MODEL_A7) radio->setTxPower(txp, PA_OUTPUT_PA_BOOST_PIN); if (model == MODEL_A8) radio->setTxPower(txp, PA_OUTPUT_PA_BOOST_PIN); @@ -1333,7 +1334,7 @@ bool eeprom_model_valid() { #elif BOARD_MODEL == BOARD_RNODE_NG_21 if (model == MODEL_A2 || model == MODEL_A7) { #elif BOARD_MODEL == BOARD_T3S3 - if (model == MODEL_A1 || model == MODEL_A6) { + if (model == MODEL_A1 || model == MODEL_A5 || model == MODEL_A6) { #elif BOARD_MODEL == BOARD_HMBRW if (model == MODEL_FF || model == MODEL_FE) { #elif BOARD_MODEL == BOARD_TBEAM From fee8d2b28beea9cab816e3bbec20385e726a5d4d Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 9 Jul 2024 10:38:39 +0100 Subject: [PATCH 4/8] Add todo --- Utilities.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utilities.h b/Utilities.h index 8125203..58219f9 100644 --- a/Utilities.h +++ b/Utilities.h @@ -965,6 +965,9 @@ void set_implicit_length(uint8_t len) { } void setTXPower(RadioInterface* radio, int txp) { + // Todo, revamp this function. The current parameters for setTxPower are + // suboptimal, as some chips have power amplifiers which means that the max + // dBm is not always the same. if (model == MODEL_11) { if (interfaces[radio->getIndex()] == SX128X) { radio->setTxPower(txp, PA_OUTPUT_PA_BOOST_PIN); From a287d7b01c427707cfb261a3162d677b3ccac220 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Sat, 20 Jul 2024 16:47:01 +0100 Subject: [PATCH 5/8] Add rak4631_sx1280 and freenode board variant targets --- Boards.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- Makefile | 22 ++++++++++++++++++---- ROM.h | 3 ++- Utilities.h | 4 +--- 4 files changed, 73 insertions(+), 9 deletions(-) diff --git a/Boards.h b/Boards.h index a3512fb..c8c4d94 100644 --- a/Boards.h +++ b/Boards.h @@ -629,7 +629,7 @@ #endif #elif MCU_VARIANT == MCU_NRF52 - #if BOARD_MODEL == BOARD_RAK4631 + #if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_FREENODE #define HAS_EEPROM false #define HAS_DISPLAY true #define DISPLAY EINK_BW @@ -647,6 +647,7 @@ #define BLE_MANUFACTURER "RAK Wireless" #define BLE_MODEL "RAK4640" + #if BOARD_VARIANT == MODEL_11 || BOARD_VARIANT == MODEL_12 #define INTERFACE_COUNT 1 // first interface in list is the primary @@ -674,6 +675,56 @@ -1 // pin_tcxo_enable } }; + #elif BOARD_VARIANT == MODEL_13 || BOARD_VARIANT == MODEL_14 || BOARD_VARIANT == MODEL_21 + #define INTERFACE_COUNT 2 + + #define CONFIG_QUEUE_1_SIZE 20000 + + // first interface in list is the primary + const uint8_t interfaces[INTERFACE_COUNT] = {SX126X, SX128X}; + const bool interface_cfg[INTERFACE_COUNT][3] = { + // SX1262 + { + false, // DEFAULT_SPI + true, // HAS_TCXO + true // DIO2_AS_RF_SWITCH + }, + // SX1280 + { + true, // DEFAULT_SPI + false,// HAS_TCXO + false // DIO2_AS_RF_SWITCH + } + }; + const int8_t interface_pins[INTERFACE_COUNT][10] = { + // SX1262 + { + 42, // pin_ss + 43, // pin_sclk + 44, // pin_mosi + 45, // pin_miso + 46, // pin_busy + 47, // pin_dio + 38, // pin_reset + -1, // pin_txen + 37, // pin_rxen + -1 // pin_tcxo_enable + }, + // SX1280 + { + 24, // pin_ss + 3, // pin_sclk + 30, // pin_mosi + 29, // pin_miso + 25, // pin_busy + 15, // pin_dio + 16, // pin_reset + 20, // pin_txen + 19, // pin_rxen + -1 // pin_tcxo_enable + } + }; + #endif #define INTERFACE_SPI // Required because on RAK4631, non-default SPI pins must be initialised when class is declared. diff --git a/Makefile b/Makefile index f4712e0..fa92457 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,13 @@ firmware-genericesp32: arduino-cli compile --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: - arduino-cli compile --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 --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\" \"-DBOARD_VARIANT=0x12\"" + +firmware-rak4631_sx1280: + arduino-cli compile --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\" \"-DBOARD_VARIANT=0x14\"" + +firmware-freenode: + arduino-cli compile --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\" \"-DBOARD_VARIANT=0x21\"" upload: arduino-cli upload -p /dev/ttyUSB0 --fqbn unsignedio:avr:rnode @@ -206,8 +212,6 @@ upload-rak4631: unzip -o build/rakwireless.nrf52.WisCoreRAK4631Board/RNode_Firmware_CE.ino.zip -d build/rakwireless.nrf52.WisCoreRAK4631Board rnodeconf /dev/ttyACM0 --firmware-hash $$(sha256sum ./build/rakwireless.nrf52.WisCoreRAK4631Board/RNode_Firmware_CE.ino.bin | grep -o '^\S*') - - release: release-all release-all: console-site spiffs-image release-tbeam release-tbeam_sx1262 release-lora32_v10 release-lora32_v20 release-lora32_v21 release-lora32_v10_extled release-lora32_v20_extled release-lora32_v21_extled release-lora32_v21_tcxo release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v3 release-heltec32_v2_extled release-rnode_ng_20 release-rnode_ng_21 release-t3s3 release-hashes @@ -374,6 +378,16 @@ release-mega2560: rm -r build release-rak4631: - arduino-cli compile --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 --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\" \"-DBOARD_VARIANT=0x12\"" cp build/rakwireless.nrf52.WisCoreRAK4631Board/RNode_Firmware_CE.ino.hex build/rnode_firmware_rak4631.hex adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application build/rnode_firmware_rak4631.hex Release/rnode_firmware_rak4631.zip + +release-rak4631_sx1280: + arduino-cli compile --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\" \"-DBOARD_VARIANT=0x14\"" + cp build/rakwireless.nrf52.WisCoreRAK4631Board/RNode_Firmware_CE.ino.hex build/rnode_firmware_rak4631_sx1280.hex + adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application build/rnode_firmware_rak4631_sx1280.hex Release/rnode_firmware_rak4631_sx1280.zip + +release-freenode: + arduino-cli compile --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\" \"-DBOARD_VARIANT=0x21\"" + cp build/rakwireless.nrf52.WisCoreRAK4631Board/RNode_Firmware_CE.ino.hex build/rnode_firmware_freenode.hex + adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application build/rnode_firmware_freenode.hex Release/rnode_firmware_freenode.zip diff --git a/ROM.h b/ROM.h index 2998635..323449d 100644 --- a/ROM.h +++ b/ROM.h @@ -30,7 +30,8 @@ #define PRODUCT_FREENODE 0x20 #define MODEL_11 0x11 #define MODEL_12 0x12 - #define MODEL_13 0x13 // RAK4631 with WisBlock SX1280 module (LIBSYS002) + #define MODEL_13 0x13 // RAK4631 LF with WisBlock SX1280 module (LIBSYS002) + #define MODEL_14 0x14 // RAK4631 HF with WisBlock SX1280 module (LIBSYS002) #define MODEL_21 0x21 // European band, 868MHz #define MODEL_A1 0xA1 #define MODEL_A5 0xA5 // T3S3 SX1280 PA diff --git a/Utilities.h b/Utilities.h index 17a6fa9..3f0a8b8 100644 --- a/Utilities.h +++ b/Utilities.h @@ -1361,9 +1361,7 @@ bool eeprom_model_valid() { #elif BOARD_MODEL == BOARD_HELTEC32_V3 if (model == MODEL_C5 || model == MODEL_CA) { #elif BOARD_MODEL == BOARD_RAK4631 - if (model == MODEL_11 || model == MODEL_12) { - #elif BOARD_MODEL == BOARD_FREENODE - if (model == MODEL_21) { + if (model == MODEL_11 || model == MODEL_12 || model == MODEL_13 || model == MODEL_14 || model == MODEL_21) { #elif BOARD_MODEL == BOARD_HUZZAH32 if (model == MODEL_FF) { #elif BOARD_MODEL == BOARD_GENERIC_ESP32 From f643eba8bbd459c1ca4bbc074dbfcd78959065aa Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 23 Jul 2024 20:05:02 +0100 Subject: [PATCH 6/8] Add freeNode as supported product --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 12b9b0b..82ef96d 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ You must have at least version `2.1.3` of `rnodeconf` installed to update the RN | Name | Manufacturer | Link | Transceiver | MCU | Description | | :---: | :---: | :---: | :---: | :---: | :---: | | Handheld v2.x RNodes | [Mark Qvist](https://unsigned.io) | [Buy here](https://unsigned.io/shop/product/handheld-rnode) | SX1276 | ESP32 | +| freeNode | [Liberated Embedded Systems](https://liberatedsystems.co.uk) | [Buy here](https://store.liberatedsystems.co.uk/product/freenode/) | SX1262 & SX1280 | nRF52 | Supports utilisation of both modems at once | ### Homebrew devices | Board name | Link | Transceiver | MCU | Description | From 02c691481b86237498ef7cc2a8f324ad6d960d66 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Wed, 24 Jul 2024 08:55:20 +0100 Subject: [PATCH 7/8] Rename freeNode to openCom XL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82ef96d..9935a0e 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ You must have at least version `2.1.3` of `rnodeconf` installed to update the RN | Name | Manufacturer | Link | Transceiver | MCU | Description | | :---: | :---: | :---: | :---: | :---: | :---: | | Handheld v2.x RNodes | [Mark Qvist](https://unsigned.io) | [Buy here](https://unsigned.io/shop/product/handheld-rnode) | SX1276 | ESP32 | -| freeNode | [Liberated Embedded Systems](https://liberatedsystems.co.uk) | [Buy here](https://store.liberatedsystems.co.uk/product/freenode/) | SX1262 & SX1280 | nRF52 | Supports utilisation of both modems at once | +| openCom XL | [Liberated Embedded Systems](https://liberatedsystems.co.uk) | [Buy here](https://store.liberatedsystems.co.uk/product/opencom-xl/) | SX1262 & SX1280 | nRF52 | Supports utilisation of both modems at once | ### Homebrew devices | Board name | Link | Transceiver | MCU | Description | From 003aab4072958ed58d4003a046fb0722afe1559b Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Wed, 24 Jul 2024 15:52:08 +0100 Subject: [PATCH 8/8] Fix issue with SX1280 TX power not being set properly --- Radio.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Radio.cpp b/Radio.cpp index 57ae164..585cceb 100644 --- a/Radio.cpp +++ b/Radio.cpp @@ -2295,7 +2295,7 @@ void sx128x::setTxPower(int level, int outputPin) { break; } - tx_buf[0] = reg_value; + tx_buf[0] = reg_value + 18; tx_buf[1] = 0xE0; // ramping time - 20 microseconds executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2); @@ -2381,7 +2381,7 @@ void sx128x::setTxPower(int level, int outputPin) { break; } - tx_buf[0] = level; + tx_buf[0] = reg_value + 18; tx_buf[1] = 0xE0; // ramping time - 20 microseconds #else // For SX1280 boards with no specific PA requirements @@ -2393,7 +2393,7 @@ void sx128x::setTxPower(int level, int outputPin) { _txp = level; - tx_buf[0] = level; + tx_buf[0] = level + 18; tx_buf[1] = 0xE0; // ramping time - 20 microseconds #endif executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2);