Skip to content

Commit

Permalink
Merge branch 'mega' into feature/Improvements-and-fixes-dec-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
tonhuisman authored Dec 19, 2024
2 parents e50cdfb + 9e560a5 commit 32532a7
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 30 deletions.
4 changes: 0 additions & 4 deletions boards/esp32_solo1_4M.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"build": {
"arduino":{
"ldscript": "esp32_out.ld",
"memory_type": "dio_qspi"
},
"core": "esp32",
"extra_flags": "-DARDUINO_TASMOTA -DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DCORE32SOLO1 -DESP32_CLASSIC",
"f_cpu": "160000000L",
Expand Down
5 changes: 5 additions & 0 deletions docs/source/Reference/GPIO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,14 @@ ESP32-C3 SPI flash pins

Pins connected to flash or PSRAM should not be used for anything else.

On boards with embedded flash, these pins cannot be used:

* GPIO-11: Flash voltage selector
* GPIO-12 ... -17: Connected to flash

On boards with external flash, GPIO-11, GPIO-12 and GPIO-13 can be selected.
However special care should be taken as some boards can still have these pins wired to the flash chip.

.. note:: By default VDD_SPI is the power supply pin for embedded flash or external flash. It can only be used as GPIO-11 only when the chip is connected to an external flash, and this flash is powered by an external power supply.


Expand Down
9 changes: 4 additions & 5 deletions platformio_core_defs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extra_scripts = ${esp82xx_common.extra_scripts}
; IDF 4.4 = platform-espressif32 3.4.x = espressif/arduino-esp32 tag 2.0.4
; Just for those who lost track of the extremely confusing numbering schema.
; For MUSTFIX_CLIENT_TIMEOUT_IN_SECONDS See: https://github.com/espressif/arduino-esp32/pull/6676
[core_esp32_IDF5_1_4__3_0_5_SPIFFS]
[core_esp32_IDF5_1_4__3_1_0_SPIFFS]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.09.10/platform-espressif32.zip
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3202/framework-arduinoespressif32-all-release_v5.1-41a885b.zip
build_flags = -DESP32_STAGE
Expand Down Expand Up @@ -196,9 +196,8 @@ lib_extra_dirs =


; ESP_IDF 5.3.1
[core_esp32_IDF5_3_1__3_0_5_LittleFS]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53
;platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.10.31/platform-espressif32.zip
[core_esp32_IDF5_3_2__3_1_0_LittleFS]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3203/framework-arduinoespressif32-all-release_v5.3-ddc10306.zip
build_flags = -DESP32_STAGE
-DESP_IDF_VERSION_MAJOR=5
Expand All @@ -219,7 +218,7 @@ build_flags = -DESP32_STAGE
-include "ESPEasy_config.h"
-include "esp32x_fixes.h"
-Wnull-dereference
lib_ignore =
lib_ignore =
lib_extra_dirs =
lib/lib_ssl

Expand Down
14 changes: 7 additions & 7 deletions platformio_esp32_envs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


[esp32_base]
extends = common, core_esp32_IDF5_1_4__3_0_5_SPIFFS
extends = common, core_esp32_IDF5_1_4__3_1_0_SPIFFS
upload_speed = 460800
upload_before_reset = default_reset
upload_after_reset = hard_reset
Expand All @@ -19,7 +19,7 @@ extra_scripts = post:tools/pio/post_esp32.py
; pre:tools/pio/apply_patches.py
build_unflags = -Wall
-fno-lto
build_flags = ${core_esp32_IDF5_1_4__3_0_5_SPIFFS.build_flags}
build_flags = ${core_esp32_IDF5_1_4__3_1_0_SPIFFS.build_flags}
; ${mqtt_flags.build_flags}
-DMQTT_MAX_PACKET_SIZE=2048
-DCONFIG_FREERTOS_ASSERT_DISABLE
Expand All @@ -30,11 +30,11 @@ build_flags = ${core_esp32_IDF5_1_4__3_0_5_SPIFFS.build_flags}
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
monitor_filters = esp32_exception_decoder
lib_ignore =
${core_esp32_IDF5_1_4__3_0_5_SPIFFS.lib_ignore}
${core_esp32_IDF5_1_4__3_1_0_SPIFFS.lib_ignore}


[esp32_base_idf5]
extends = common, core_esp32_IDF5_3_1__3_0_5_LittleFS
extends = common, core_esp32_IDF5_3_2__3_1_0_LittleFS
upload_speed = 460800
upload_before_reset = default_reset
upload_after_reset = hard_reset
Expand All @@ -51,7 +51,7 @@ extra_scripts = post:tools/pio/post_esp32.py
; However LTO cannot optimize builds with text section literals and thus will result in quite a lot larger builds (80k - 140k larger)
build_unflags = -Wall
-fno-lto
build_flags = ${core_esp32_IDF5_3_1__3_0_5_LittleFS.build_flags}
build_flags = ${core_esp32_IDF5_3_2__3_1_0_LittleFS.build_flags}
; ${mqtt_flags.build_flags}
-DMQTT_MAX_PACKET_SIZE=2048
-DCONFIG_FREERTOS_ASSERT_DISABLE
Expand All @@ -65,7 +65,7 @@ build_flags = ${core_esp32_IDF5_3_1__3_0_5_LittleFS.build_flags}
-DLWIP_IPV6=1
monitor_filters = esp32_exception_decoder
lib_ignore =
${core_esp32_IDF5_3_1__3_0_5_LittleFS.lib_ignore}
${core_esp32_IDF5_3_2__3_1_0_LittleFS.lib_ignore}


; -flto cannot be used for ESP32 C3!
Expand Down Expand Up @@ -116,7 +116,7 @@ board_build.filesystem = littlefs
lib_ignore = ${esp32_always.lib_ignore}
ESP32_ping
ESP32 BLE Arduino
${core_esp32_IDF5_3_1__3_0_5_LittleFS.lib_ignore}
${core_esp32_IDF5_3_2__3_1_0_LittleFS.lib_ignore}


[esp32_IRExt]
Expand Down
6 changes: 3 additions & 3 deletions platformio_esp32_solo1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
; IDF 5.3.1
[esp32_solo1_common_LittleFS]
extends = esp32_base_idf5
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53
;platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.12.30/platform-espressif32.zip
platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3204/framework-arduinoespressif32-solo1-release_v5.3-ddc10306.zip
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53
platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3204/framework-arduinoespressif32-solo1-release_v5.3-ddc10306.zip
build_flags = ${esp32_base_idf5.build_flags}
-DFEATURE_ARDUINO_OTA=1
-DUSE_LITTLEFS
-DCORE32SOLO1
extra_scripts = ${esp32_base_idf5.extra_scripts}
build_unflags = ${esp32_base_idf5.build_unflags}
-fexceptions
Expand Down
14 changes: 10 additions & 4 deletions src/src/ESPEasyCore/ESPEasy_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ void ESPEasy_setup()

if (pkg_version <= 7) { // D0WD, S0WD, D2WD
#ifdef CORE32SOLO1
gpio_num_t PSRAM_CLK = GPIO_NUM_17;
gpio_num_t PSRAM_CS = GPIO_NUM_16;
gpio_num_t PSRAM_CLK = GPIO_NUM_NC; //GPIO_NUM_17;
gpio_num_t PSRAM_CS = GPIO_NUM_NC; //GPIO_NUM_16;
#else
gpio_num_t PSRAM_CLK = static_cast<gpio_num_t>(CONFIG_D0WD_PSRAM_CLK_IO);
gpio_num_t PSRAM_CS = static_cast<gpio_num_t>(CONFIG_D0WD_PSRAM_CS_IO);
Expand All @@ -187,14 +187,18 @@ void ESPEasy_setup()
if (PSRAM_CLK != GPIO_NUM_NC) {
esp_gpio_revoke(BIT64(PSRAM_CLK) | BIT64(PSRAM_CS));
} else {
esp_gpio_revoke(BIT64(PSRAM_CS));
if (PSRAM_CS != GPIO_NUM_NC) {
esp_gpio_revoke(BIT64(PSRAM_CS));
}
}
# endif // if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 2, 0)

if (PSRAM_CLK != GPIO_NUM_NC) {
gpio_reset_pin(PSRAM_CLK);
}
gpio_reset_pin(PSRAM_CS);
if (PSRAM_CS != GPIO_NUM_NC) {
gpio_reset_pin(PSRAM_CS);
}
}
}
# endif // if CONFIG_IDF_TARGET_ESP32
Expand Down Expand Up @@ -359,6 +363,7 @@ void ESPEasy_setup()
#endif // ifndef BUILD_NO_RAM_TRACKER

#ifdef ESP32
#ifndef CORE32SOLO1

// Configure dynamic frequency scaling:
// maximum and minimum frequencies are set in sdkconfig,
Expand All @@ -373,6 +378,7 @@ void ESPEasy_setup()
# endif // if CONFIG_FREERTOS_USE_TICKLESS_IDLE
};
esp_pm_configure(&pm_config);
#endif
#endif // ifdef ESP32


Expand Down
32 changes: 25 additions & 7 deletions src/src/Helpers/Hardware_GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,35 @@ bool getGpioInfo(int gpio, int& pinnr, bool& input, bool& output, bool& warning)
}

if (gpio == 11) {
// By default VDD_SPI is the power supply pin for embedded flash or external flash. It can only be used as GPIO11
// only when the chip is connected to an external flash, and this flash is powered by an external power supply
input = false;
output = false;
if (getChipFeatures().embeddedFlash) {
// See: https://www.letscontrolit.com/forum/viewtopic.php?p=71880#p71874
//
// By default VDD_SPI is the power supply pin for embedded flash or external flash.
// It can only be used as GPIO11 only when the chip is connected to an
// external flash, and this flash is powered by an external power supply
input = false;
output = false;
}
warning = true;
}

if (isFlashInterfacePin_ESPEasy(gpio)) {
// Connected to the integrated SPI flash.
input = false;
output = false;
if (getChipFeatures().embeddedFlash) {
// Connected to the integrated SPI flash.
input = false;
output = false;
} else {
// See: https://www.letscontrolit.com/forum/viewtopic.php?p=71880#p71874
if (gpio == 12 || gpio == 13) {
// SPIHD/GPIO12
// SPIWP/GPIO13
if (ESP.getFlashChipMode() != FM_DOUT &&
ESP.getFlashChipMode() != FM_DIO) {
input = false;
output = false;
}
}
}
warning = true;
}

Expand Down

0 comments on commit 32532a7

Please sign in to comment.