mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Add ESP32S3 (Liligo) as S3 Mini
This commit is contained in:
@@ -252,7 +252,8 @@ export const BOARD_PROFILES: BoardProfiles = {
|
||||
OLIMEX: 'Olimex ESP32-EVB',
|
||||
OLIMEXPOE: 'Olimex ESP32-POE',
|
||||
C3MINI: 'Wemos C3 Mini',
|
||||
S2MINI: 'Wemos S2 Mini'
|
||||
S2MINI: 'Wemos S2 Mini',
|
||||
S3MINI: 'Liligo S3'
|
||||
};
|
||||
|
||||
export interface BoardProfileName {
|
||||
|
||||
@@ -70,6 +70,11 @@ void UploadFileService::handleUpload(AsyncWebServerRequest * request, const Stri
|
||||
handleError(request, 503); // service unavailable
|
||||
return;
|
||||
}
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
if (len > 12 && (data[0] != 0xE9 || data[12] != 3)) {
|
||||
handleError(request, 503); // service unavailable
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// it's firmware - initialize the ArduinoOTA updater
|
||||
if (Update.begin(fsize)) {
|
||||
|
||||
@@ -1188,6 +1188,17 @@ rest_server.post(EMSESP_BOARDPROFILE_ENDPOINT, (req, res) => {
|
||||
data.eth_power = 0
|
||||
data.eth_phy_addr = 0
|
||||
data.eth_clock_mode = 0
|
||||
} else if (board_profile == 'S3MINI') {
|
||||
// Liligo S3 mini
|
||||
data.led_gpio = 17
|
||||
data.dallas_gpio = 18
|
||||
data.rx_gpio = 8
|
||||
data.tx_gpio = 5
|
||||
data.pbutton_gpio = 0
|
||||
data.phy_type = 0
|
||||
data.eth_power = 0
|
||||
data.eth_phy_addr = 0
|
||||
data.eth_clock_mode = 0
|
||||
}
|
||||
|
||||
console.log('boardProfile POST. Sending back, profile: ' + board_profile + ', ' + 'data: ' + JSON.stringify(data))
|
||||
|
||||
@@ -118,3 +118,15 @@ board_upload.flash_size = 4MB
|
||||
board_build.partitions = esp32_partition_4M.csv
|
||||
build_flags = ${common.build_flags}
|
||||
build_unflags = ${common.unbuild_flags}
|
||||
|
||||
[env:esp32s3]
|
||||
extra_scripts =
|
||||
pre:scripts/build_interface.py
|
||||
scripts/rename_fw.py
|
||||
board = lolin_s3
|
||||
platform = espressif32@5.2.0
|
||||
board_upload.flash_size = 16MB
|
||||
board_build.partitions = esp32_partition_16M.csv
|
||||
build_flags = ${common.build_flags}
|
||||
build_unflags = ${common.unbuild_flags}
|
||||
upload_protocol = esptool
|
||||
|
||||
@@ -694,7 +694,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
std::vector<int8_t> data; // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode
|
||||
std::string board_profile = Helpers::toUpper(arguments.front());
|
||||
if (!EMSESP::system_.load_board_profile(data, board_profile)) {
|
||||
shell.println("Invalid board profile (S32, E32, MH-ET, NODEMCU, OLIMEX, OLIMEXPOE, C3MINI, S2MINI, CUSTOM)");
|
||||
shell.println("Invalid board profile (S32, E32, MH-ET, NODEMCU, OLIMEX, OLIMEXPOE, C3MINI, S2MINI, S3MINI, CUSTOM)");
|
||||
return;
|
||||
}
|
||||
EMSESP::webSettingsService.update(
|
||||
|
||||
@@ -236,6 +236,8 @@ enum {
|
||||
#define EMSESP_PLATFORM "ESP32-C3";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
#define EMSESP_PLATFORM "ESP32-S2";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#define EMSESP_PLATFORM "ESP32-S3";
|
||||
#elif CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
||||
#define EMSESP_PLATFORM "ESP32";
|
||||
#else
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "../esp32s2/rom/rtc.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
#include "../esp32c3/rom/rtc.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "../esp32s3/rom/rtc.h"
|
||||
#else
|
||||
#error Target CONFIG_IDF_TARGET is not supported
|
||||
#endif
|
||||
@@ -369,6 +371,8 @@ bool System::is_valid_gpio(uint8_t pin) {
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
// https://www.wemos.cc/en/latest/c3/c3_mini.html
|
||||
if ((pin >= 11 && pin <= 19) || (pin > 21)) {
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
if ((pin >= 19 && pin <= 20) || (pin >= 22 && pin <= 37) || (pin >= 39 && pin <= 42) || (pin > 48)) {
|
||||
#endif
|
||||
return false; // bad pin
|
||||
}
|
||||
@@ -1418,7 +1422,9 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
|
||||
} else if (board_profile == "C3MINI") {
|
||||
data = {7, 1, 4, 5, 9, PHY_type::PHY_TYPE_NONE, 0, 0, 0}; // Lolin C3 Mini
|
||||
} else if (board_profile == "S2MINI") {
|
||||
data = {15, 7, 11, 12, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0}; //Lolin S2 Mini
|
||||
data = {15, 7, 11, 12, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0}; // Lolin S2 Mini
|
||||
} else if (board_profile == "S3MINI") {
|
||||
data = {17, 18, 8, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0}; // Liligo S3
|
||||
} else if (board_profile == "CUSTOM") {
|
||||
// send back current values
|
||||
data = {(int8_t)EMSESP::system_.led_gpio_,
|
||||
|
||||
@@ -91,6 +91,8 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
||||
settings.board_profile = root["board_profile"] | "C3MINI";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
settings.board_profile = root["board_profile"] | "S2MINI";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
settings.board_profile = root["board_profile"] | "S3MINI";
|
||||
#elif CONFIG_IDF_TARGET_ESP32
|
||||
settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user