Support for Seeed XIAO S3 Board (#4850)

* feat: add seeed-xiao-s3 board defination and pins defination

* chore:  add SEEED XIAO S3 into mesh pb

* fix: fix trunk fmt check failed

* Trunk fmt variant.h

* Restore automatically generated file

---------

Co-authored-by: Tom Fifield <tom@tomfifield.net>
This commit is contained in:
dylanli 2024-09-25 18:27:14 +08:00 committed by GitHub
parent bebd2bb9e0
commit 1293c5cdd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 165 additions and 0 deletions

41
boards/seeed-xiao-s3.json Normal file
View File

@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=0"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [["0x2886", "0x0059"]],
"mcu": "esp32s3",
"variant": "seeed-xiao-s3"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "seeed-xiao-s3",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 8388608,
"maximum_size": 8388608,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html",
"vendor": "Seeed Studio"
}

View File

@ -170,6 +170,8 @@
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_NODE_T114
#elif defined(SENSECAP_INDICATOR)
#define HW_VENDOR meshtastic_HardwareModel_SENSECAP_INDICATOR
#elif defined(SEEED_XIAO_S3)
#define HW_VENDOR meshtastic_HardwareModel_SEEED_XIAO_S3
#endif
// -----------------------------------------------------------------------------

View File

@ -0,0 +1,21 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#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 = 41;
#endif /* Pins_Arduino_h */

View File

@ -0,0 +1,17 @@
[env:seeed-xiao-s3]
extends = esp32s3_base
board = seeed-xiao-s3
board_check = true
board_build.mcu = esp32s3
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

View File

@ -0,0 +1,84 @@
/*
*/
/*
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
/*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 1
#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 41
#define LORA_RESET 42
#define LORA_DIO1 39
#define LORA_DIO2 38
#ifdef USE_SX1262
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY 40
#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_DIO3_TCXO_VOLTAGE 1.8
#endif