From 3c586c23a30a05cbfed17bfd8f6630198d8fc936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 14 Apr 2026 12:06:11 +0200 Subject: [PATCH] Split out G3 and M7 to different variants. Completely new PCB design. The G3 stays on 'PRIVATE_HW' --- .../ELECROW-ThinkNode-G3/pins_arduino.h | 26 ++++++++++ .../ELECROW-ThinkNode-G3/platformio.ini | 20 ++++++++ .../esp32s3/ELECROW-ThinkNode-G3/variant.h | 36 ++++++++++++++ .../ELECROW-ThinkNode-M7/pins_arduino.h | 19 +++---- .../ELECROW-ThinkNode-M7/platformio.ini | 1 - .../esp32s3/ELECROW-ThinkNode-M7/rfswitch.h | 11 +++++ .../esp32s3/ELECROW-ThinkNode-M7/variant.h | 49 ++++++++++--------- 7 files changed, 124 insertions(+), 38 deletions(-) create mode 100644 variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h create mode 100644 variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini create mode 100644 variants/esp32s3/ELECROW-ThinkNode-G3/variant.h create mode 100644 variants/esp32s3/ELECROW-ThinkNode-M7/rfswitch.h diff --git a/variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h b/variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h new file mode 100644 index 000000000..359355772 --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h @@ -0,0 +1,26 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SDA = 17; +static const uint8_t SCL = 18; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 39; +static const uint8_t MOSI = 40; +static const uint8_t MISO = 41; +static const uint8_t SCK = 42; + +// #define SPI_MOSI (11) +// #define SPI_SCK (10) +// #define SPI_MISO (9) +// #define SPI_CS (12) + +// #define SDCARD_CS SPI_CS + +#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini b/variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini new file mode 100644 index 000000000..e2c83efe5 --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini @@ -0,0 +1,20 @@ +[env:thinknode_g3] +extends = esp32s3_base +board = ESP32-S3-WROOM-1-N4 +board_build.psram_type = opi + +build_flags = + ${esp32s3_base.build_flags} + -D HAS_UDP_MULTICAST=1 + -D BOARD_HAS_PSRAM + -D PRIVATE_HW + -I variants/esp32s3/ELECROW-ThinkNode-G3 + -mfix-esp32-psram-cache-issue + +lib_ignore = + Ethernet + +lib_deps = + ${esp32s3_base.lib_deps} + # renovate: datasource=github-tags depName=ESP32-CH390 packageName=meshtastic/ESP32-CH390 + https://github.com/meshtastic/ESP32-CH390/archive/refs/tags/v1.0.1.zip diff --git a/variants/esp32s3/ELECROW-ThinkNode-G3/variant.h b/variants/esp32s3/ELECROW-ThinkNode-G3/variant.h new file mode 100644 index 000000000..c5afd574a --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-G3/variant.h @@ -0,0 +1,36 @@ +#define HAS_GPS 0 +#define HAS_WIRE 0 +#define I2C_NO_RESCAN + +#define WIFI_LED 5 +#define WIFI_STATE_ON 0 + +#define LED_PIN 6 +#define LED_STATE_ON 0 +#define BUTTON_PIN 4 + +#define LORA_SCK 42 +#define LORA_MISO 41 +#define LORA_MOSI 40 +#define LORA_CS 39 +#define LORA_RESET 21 + +#define USE_SX1262 +#define SX126X_CS LORA_CS +#define SX126X_DIO1 15 +#define SX126X_BUSY 47 +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#define PIN_POWER_EN 45 + +#define HAS_ETHERNET 1 +#define USE_CH390D 1 + +#define ETH_MISO_PIN 12 +#define ETH_MOSI_PIN 11 +#define ETH_SCLK_PIN 13 +#define ETH_CS_PIN 14 +#define ETH_INT_PIN 10 +#define ETH_RST_PIN 9 +// #define ETH_ADDR 1 diff --git a/variants/esp32s3/ELECROW-ThinkNode-M7/pins_arduino.h b/variants/esp32s3/ELECROW-ThinkNode-M7/pins_arduino.h index 359355772..bcc9cd1d5 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M7/pins_arduino.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M7/pins_arduino.h @@ -10,17 +10,10 @@ static const uint8_t SDA = 17; static const uint8_t SCL = 18; -// Default SPI will be mapped to Radio -static const uint8_t SS = 39; -static const uint8_t MOSI = 40; -static const uint8_t MISO = 41; -static const uint8_t SCK = 42; +// Default SPI is the LR1110 radio bus +static const uint8_t SS = 12; +static const uint8_t MOSI = 10; +static const uint8_t MISO = 9; +static const uint8_t SCK = 11; -// #define SPI_MOSI (11) -// #define SPI_SCK (10) -// #define SPI_MISO (9) -// #define SPI_CS (12) - -// #define SDCARD_CS SPI_CS - -#endif /* Pins_Arduino_h */ \ No newline at end of file +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/ELECROW-ThinkNode-M7/platformio.ini b/variants/esp32s3/ELECROW-ThinkNode-M7/platformio.ini index 8120b15fa..78b8fffb0 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M7/platformio.ini +++ b/variants/esp32s3/ELECROW-ThinkNode-M7/platformio.ini @@ -8,7 +8,6 @@ build_flags = -D ELECROW_ThinkNode_M7 -D HAS_UDP_MULTICAST=1 -D BOARD_HAS_PSRAM - -D PRIVATE_HW -I variants/esp32s3/ELECROW-ThinkNode-M7 -mfix-esp32-psram-cache-issue diff --git a/variants/esp32s3/ELECROW-ThinkNode-M7/rfswitch.h b/variants/esp32s3/ELECROW-ThinkNode-M7/rfswitch.h new file mode 100644 index 000000000..9bf672896 --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-M7/rfswitch.h @@ -0,0 +1,11 @@ +#include "RadioLib.h" + +static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC}; + +static const Module::RfSwitchMode_t rfswitch_table[] = { + + {LR11x0::MODE_STBY, {LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW}}, + {LR11x0::MODE_TX, {LOW, HIGH}}, {LR11x0::MODE_TX_HP, {LOW, LOW}}, + {LR11x0::MODE_TX_HF, {LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW}}, + {LR11x0::MODE_WIFI, {LOW, LOW}}, END_OF_MODE_TABLE, +}; diff --git a/variants/esp32s3/ELECROW-ThinkNode-M7/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M7/variant.h index 158b75a71..801d8d0c6 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M7/variant.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M7/variant.h @@ -2,35 +2,36 @@ #define HAS_WIRE 0 #define I2C_NO_RESCAN -#define WIFI_LED 5 +#define WIFI_LED 3 #define WIFI_STATE_ON 0 -#define LED_PIN 6 // The blue LORA LED +#define LED_PIN 46 #define LED_STATE_ON 0 -#define BUTTON_PIN 4 // the external user button of the device, BOOT and RESET are not accessible without opening it. +#define BUTTON_PIN 4 -#define USE_SX1262 -#define LORA_SCK 42 -#define LORA_MISO 41 -#define LORA_MOSI 40 -#define LORA_CS 39 -#define LORA_RESET 21 +#define LORA_SCK 11 +#define LORA_MISO 9 +#define LORA_MOSI 10 +#define LORA_CS 12 +#define LORA_RESET 39 -#define SX126X_CS LORA_CS -#define SX126X_DIO1 15 -#define SX126X_BUSY 47 -#define SX126X_RESET LORA_RESET -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 -#define PIN_POWER_EN 45 +#define USE_LR1110 +#define LR1110_SPI_SCK_PIN LORA_SCK +#define LR1110_SPI_MISO_PIN LORA_MISO +#define LR1110_SPI_MOSI_PIN LORA_MOSI +#define LR1110_SPI_NSS_PIN LORA_CS +#define LR1110_IRQ_PIN 38 +#define LR1110_BUSY_PIN 13 +#define LR1110_NRESET_PIN LORA_RESET +#define LR11X0_DIO3_TCXO_VOLTAGE 1.8 +#define LR11X0_DIO_AS_RF_SWITCH #define HAS_ETHERNET 1 -#define USE_CH390D 1 // this driver uses the same stack as the ESP32 Wifi driver +#define USE_CH390D 1 -#define ETH_MISO_PIN 12 -#define ETH_MOSI_PIN 11 -#define ETH_SCLK_PIN 13 -#define ETH_CS_PIN 14 -#define ETH_INT_PIN 10 -#define ETH_RST_PIN 9 -// #define ETH_ADDR 1 \ No newline at end of file +#define ETH_MISO_PIN 14 +#define ETH_MOSI_PIN 48 +#define ETH_SCLK_PIN 47 +#define ETH_CS_PIN 21 +#define ETH_INT_PIN 45 +// #define ETH_ADDR 1