From dd840a3080456c678849bfc1b6338b41e5caf559 Mon Sep 17 00:00:00 2001 From: Sabering <39810634+Sabering1@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:11:25 +0200 Subject: [PATCH 1/6] Create variant.h --- variants/ seeed_s3_gpio/variant.h | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 variants/ seeed_s3_gpio/variant.h diff --git a/variants/ seeed_s3_gpio/variant.h b/variants/ seeed_s3_gpio/variant.h new file mode 100644 index 000000000..63f62a629 --- /dev/null +++ b/variants/ seeed_s3_gpio/variant.h @@ -0,0 +1,90 @@ +/* + ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ +▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌ +▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ +▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ +▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ +▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ + ▀▀▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ + ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ + ▄▄▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ +▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌ + ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ + + ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ + ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ + ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀█░▌ + ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ + ▐░▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄█░▌ + ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ + ▐░▌░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ + ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ + ▐░▌ ▐░▌ ▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ + ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ + ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ +*/ + +/* +Board Information: https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html +Expansion Board Infomation : https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html +L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html +*/ + +#define LED_PIN 48 +#define LED_STATE_ON 1 // State when LED is lit + +#define BUTTON_PIN 21 // This is the Program Button +#define BUTTON_NEED_PULLUP + +#define BATTERY_PIN -1 +#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define BATTERY_SENSE_RESOLUTION_BITS 12 + +/*Warning: + https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html + L76K Expansion Board can not directly used, L76K Reset Pin needs to override or physically remove it, + otherwise it will conflict with the SPI pins +*/ +#define GPS_L76K +#ifdef GPS_L76K +#define GPS_RX_PIN 44 +#define GPS_TX_PIN 43 +#define HAS_GPS 0 +#define GPS_BAUDRATE 9600 +#define GPS_THREAD_INTERVAL 50 +#define PIN_SERIAL1_RX PIN_GPS_TX +#define PIN_SERIAL1_TX PIN_GPS_RX +#define PIN_GPS_STANDBY 1 +#endif + +// XIAO S3 Expansion board has 1.3 inch OLED Screen +#define USCREEN_SSD1306 + +#define I2C_SDA 5 +#define I2C_SCL 6 + +// XIAO S3 LORA module +#define USE_SX1262 + +#define LORA_MISO 8 +#define LORA_SCK 7 +#define LORA_MOSI 9 +#define LORA_CS 5 + +#define LORA_RESET 3 +#define LORA_DIO1 2 + +#define LORA_DIO2 5 + +#ifdef USE_SX1262 +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY 4 +#define SX126X_RESET LORA_RESET + +// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_RXEN 6 +#define SX126X_TXEN RADIOLIB_NC +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#endif From ad66a20f8e74ddf5ab8f351b29dd1678ad6e70d5 Mon Sep 17 00:00:00 2001 From: Sabering <39810634+Sabering1@users.noreply.github.com> Date: Sun, 20 Jul 2025 03:12:23 +0200 Subject: [PATCH 2/6] Add files via upload --- variants/ seeed_s3_gpio/pins_arduino.h | 21 +++++++++++++++++++++ variants/ seeed_s3_gpio/platformio.ini | 17 +++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 variants/ seeed_s3_gpio/pins_arduino.h create mode 100644 variants/ seeed_s3_gpio/platformio.ini diff --git a/variants/ seeed_s3_gpio/pins_arduino.h b/variants/ seeed_s3_gpio/pins_arduino.h new file mode 100644 index 000000000..4f81c93c5 --- /dev/null +++ b/variants/ seeed_s3_gpio/pins_arduino.h @@ -0,0 +1,21 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x2886 +#define USB_PID 0x0059 + +// GPIO48 Reference: https://github.com/espressif/arduino-esp32/pull/8600 + +// The default Wire will be mapped to Screen and Sensors +static const uint8_t SDA = 47; +static const uint8_t SCL = 48; + +// Default SPI will be mapped to Radio +static const uint8_t MISO = 8; +static const uint8_t SCK = 7; +static const uint8_t MOSI = 9; +static const uint8_t SS = 5; + +#endif /* Pins_Arduino_h */ diff --git a/variants/ seeed_s3_gpio/platformio.ini b/variants/ seeed_s3_gpio/platformio.ini new file mode 100644 index 000000000..9d935e2e0 --- /dev/null +++ b/variants/ seeed_s3_gpio/platformio.ini @@ -0,0 +1,17 @@ +[env:seeed-xiao-s3] +extends = esp32s3_base +board = seeed-xiao-s3 +board_check = true +board_build.partitions = default_8MB.csv +upload_protocol = esptool +upload_speed = 921600 +lib_deps = + ${esp32s3_base.lib_deps} +build_unflags = + ${esp32s3_base.build_unflags} + -DARDUINO_USB_MODE=1 +build_flags = + ${esp32s3_base.build_flags} -DSEEED_XIAO_S3 -I variants/seeed_xiao_s3 + -DBOARD_HAS_PSRAM + + -DARDUINO_USB_MODE=0 \ No newline at end of file From 9b90edba81faa7cba0ecc63da4c92aefcf991e58 Mon Sep 17 00:00:00 2001 From: Sabering <39810634+Sabering1@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:00:17 +0200 Subject: [PATCH 3/6] Update variants/ seeed_s3_gpio/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/ seeed_s3_gpio/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/ seeed_s3_gpio/variant.h b/variants/ seeed_s3_gpio/variant.h index 63f62a629..c6b2bd0d9 100644 --- a/variants/ seeed_s3_gpio/variant.h +++ b/variants/ seeed_s3_gpio/variant.h @@ -26,7 +26,7 @@ /* Board Information: https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html -Expansion Board Infomation : https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html +Expansion Board Information : https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html */ From 1bcf07ce19915f0bf6ee9fe0bc514d03c87ab860 Mon Sep 17 00:00:00 2001 From: Sabering <39810634+Sabering1@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:35:49 +0200 Subject: [PATCH 4/6] Update variant.h Updated for S3 module. --- variants/ seeed_s3_gpio/variant.h | 42 ++++++------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/variants/ seeed_s3_gpio/variant.h b/variants/ seeed_s3_gpio/variant.h index c6b2bd0d9..9bec13501 100644 --- a/variants/ seeed_s3_gpio/variant.h +++ b/variants/ seeed_s3_gpio/variant.h @@ -1,36 +1,10 @@ -/* - ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ -▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌ -▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ -▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ -▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ -▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ - ▀▀▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ - ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ - ▄▄▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ -▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌ - ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ - - ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ - ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ - ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀█░▌ - ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ - ▐░▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄█░▌ - ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ - ▐░▌░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ - ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ - ▐░▌ ▐░▌ ▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ - ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ - ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ -*/ - /* Board Information: https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html Expansion Board Information : https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html */ -#define LED_PIN 48 +#define LED_PIN 44 #define LED_STATE_ON 1 // State when LED is lit #define BUTTON_PIN 21 // This is the Program Button @@ -47,8 +21,8 @@ L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-S */ #define GPS_L76K #ifdef GPS_L76K -#define GPS_RX_PIN 44 -#define GPS_TX_PIN 43 +#define GPS_RX_PIN 39 +#define GPS_TX_PIN 40 #define HAS_GPS 0 #define GPS_BAUDRATE 9600 #define GPS_THREAD_INTERVAL 50 @@ -69,22 +43,22 @@ L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-S #define LORA_MISO 8 #define LORA_SCK 7 #define LORA_MOSI 9 -#define LORA_CS 5 +#define LORA_CS 4 -#define LORA_RESET 3 +#define LORA_RESET 43 #define LORA_DIO1 2 -#define LORA_DIO2 5 +#define LORA_DIO2 1 #ifdef USE_SX1262 #define SX126X_CS LORA_CS #define SX126X_DIO1 LORA_DIO1 -#define SX126X_BUSY 4 +#define SX126X_BUSY 3 #define SX126X_RESET LORA_RESET // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 #define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_RXEN 6 +#define SX126X_RXEN 1 #define SX126X_TXEN RADIOLIB_NC #define SX126X_DIO3_TCXO_VOLTAGE 1.8 #endif From e6312d5bf7609fbd9c29b8a693ef07c4a85f1c32 Mon Sep 17 00:00:00 2001 From: Sabering <39810634+Sabering1@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:38:19 +0200 Subject: [PATCH 5/6] Update platformio.ini Resolved issues --- variants/ seeed_s3_gpio/platformio.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/variants/ seeed_s3_gpio/platformio.ini b/variants/ seeed_s3_gpio/platformio.ini index 9d935e2e0..08cba84b3 100644 --- a/variants/ seeed_s3_gpio/platformio.ini +++ b/variants/ seeed_s3_gpio/platformio.ini @@ -1,9 +1,10 @@ -[env:seeed-xiao-s3] +[env:seeed-xiao-s3-gpio] extends = esp32s3_base board = seeed-xiao-s3 board_check = true board_build.partitions = default_8MB.csv upload_protocol = esptool +board_level = extra upload_speed = 921600 lib_deps = ${esp32s3_base.lib_deps} @@ -14,4 +15,4 @@ build_flags = ${esp32s3_base.build_flags} -DSEEED_XIAO_S3 -I variants/seeed_xiao_s3 -DBOARD_HAS_PSRAM - -DARDUINO_USB_MODE=0 \ No newline at end of file + -DARDUINO_USB_MODE=0 From bccfba77a867bf4a526aee572e04b2676db07d3a Mon Sep 17 00:00:00 2001 From: Sabering <39810634+Sabering1@users.noreply.github.com> Date: Sat, 26 Jul 2025 08:40:56 +0200 Subject: [PATCH 6/6] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/ seeed_s3_gpio/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/ seeed_s3_gpio/platformio.ini b/variants/ seeed_s3_gpio/platformio.ini index 08cba84b3..d14376ace 100644 --- a/variants/ seeed_s3_gpio/platformio.ini +++ b/variants/ seeed_s3_gpio/platformio.ini @@ -12,7 +12,7 @@ build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 build_flags = - ${esp32s3_base.build_flags} -DSEEED_XIAO_S3 -I variants/seeed_xiao_s3 + ${esp32s3_base.build_flags} -DSEEED_XIAO_S3 -I variants/seeed_s3_gpio -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=0