From f8227abf5397c04198cad0a5ed4d4204fd8aa434 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Thu, 26 Sep 2024 08:29:41 +0000 Subject: [PATCH 1/7] IDF release/v5.3 707d097b --- package/package_esp32_index.template.json | 68 +++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index 4df82b26bee..81329a8025f 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -42,7 +42,7 @@ { "packager": "esp32", "name": "esp32-arduino-libs", - "version": "idf-release_v5.3-4d0db704" + "version": "idf-release_v5.3-707d097b" }, { "packager": "esp32", @@ -95,63 +95,63 @@ "tools": [ { "name": "esp32-arduino-libs", - "version": "idf-release_v5.3-4d0db704", + "version": "idf-release_v5.3-707d097b", "systems": [ { "host": "i686-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "x86_64-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "arm64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-4d0db704.zip", - "checksum": "SHA-256:645b7579d22e7de73c87cce1d52629f9780de9f18be5b5b066ac0f2c210e9bef", - "size": "360076736" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.3/esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "archiveFileName": "esp32-arduino-libs-idf-release_v5.3-707d097b.zip", + "checksum": "SHA-256:834dbb3f64462ac97e7d2bc1469376bc009657dd3a6b7f6659dedf4c6cce5aba", + "size": "391817410" } ] }, From ca556ba0ab05222557762c69b05b2fabee332003 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Thu, 26 Sep 2024 07:54:52 -0300 Subject: [PATCH 2/7] fix(5.1): ESP32 redefinition to ESP32 From 7c9203e982aedb1d38660339f2feec8ed79117b1 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Thu, 26 Sep 2024 09:30:26 -0300 Subject: [PATCH 3/7] fix(wps): fixes wps struct initialization C99 complaint --- libraries/WiFi/examples/WPS/WPS.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/WiFi/examples/WPS/WPS.ino b/libraries/WiFi/examples/WPS/WPS.ino index 1a6cc6114ee..4eeafef8159 100644 --- a/libraries/WiFi/examples/WPS/WPS.ino +++ b/libraries/WiFi/examples/WPS/WPS.ino @@ -25,7 +25,14 @@ WPS (pin is 00000000) #define ESP_WPS_MODE WPS_TYPE_PBC void wpsStart() { - esp_wps_config_t config = WPS_CONFIG_INIT_DEFAULT(ESP_WPS_MODE); + esp_wps_config_t config; + //Same as config = WPS_CONFIG_INIT_DEFAULT(ESP_WPS_MODE); + config.wps_type = ESP_WPS_MODE; + strcpy(config.factory_info.manufacturer, "ESPRESSIF"); + strcpy(config.factory_info.model_number, CONFIG_IDF_TARGET); + strcpy(config.factory_info.model_name, "ESPRESSIF IOT"); + strcpy(config.factory_info.device_name, "ESP DEVICE"); + strcpy(config.pin, "00000000"); esp_err_t err = esp_wifi_wps_enable(&config); if (err != ESP_OK) { Serial.printf("WPS Enable Failed: 0x%x: %s\n", err, esp_err_to_name(err)); From 51b52f0c60362bd47af3803485846682ae9778de Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Thu, 26 Sep 2024 09:42:04 -0300 Subject: [PATCH 4/7] fix(wps): adds memset to 0 --- libraries/WiFi/examples/WPS/WPS.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/WiFi/examples/WPS/WPS.ino b/libraries/WiFi/examples/WPS/WPS.ino index 4eeafef8159..fc353dcbfb8 100644 --- a/libraries/WiFi/examples/WPS/WPS.ino +++ b/libraries/WiFi/examples/WPS/WPS.ino @@ -26,6 +26,7 @@ WPS (pin is 00000000) void wpsStart() { esp_wps_config_t config; + memset(&config, 0, sizeof(esp_wps_config_t)); //Same as config = WPS_CONFIG_INIT_DEFAULT(ESP_WPS_MODE); config.wps_type = ESP_WPS_MODE; strcpy(config.factory_info.manufacturer, "ESPRESSIF"); From 7028987d27c5163aa48d6aa4a673e264d824b74e Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 1 Oct 2024 12:50:04 +0300 Subject: [PATCH 5/7] Fix build of camera web server --- .../ESP32/examples/Camera/CameraWebServer/ci.json | 15 +++++++++++++++ .../Camera/CameraWebServer/partitions.csv | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/ci.json b/libraries/ESP32/examples/Camera/CameraWebServer/ci.json index cd679adefad..cfdf3c35cdb 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/ci.json +++ b/libraries/ESP32/examples/Camera/CameraWebServer/ci.json @@ -1,4 +1,19 @@ { + "fqbn": { + "esp32": [ + "espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=custom,FlashMode=dio", + "espressif:esp32:esp32:PSRAM=disabled,PartitionScheme=custom,FlashMode=dio" + ], + "esp32s2": [ + "espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=custom,FlashMode=dio", + "espressif:esp32:esp32s2:PSRAM=disabled,PartitionScheme=custom,FlashMode=dio" + ], + "esp32s3": [ + "espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=custom,FlashMode=qio", + "espressif:esp32:esp32s3:PSRAM=enabled,USBMode=default,PartitionScheme=custom,FlashMode=qio", + "espressif:esp32:esp32s3:PSRAM=disabled,USBMode=default,PartitionScheme=custom,FlashMode=qio" + ] + }, "targets": { "esp32c3": false, "esp32c6": false, diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/partitions.csv b/libraries/ESP32/examples/Camera/CameraWebServer/partitions.csv index 4f76ca6d746..b9f18c465a7 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/partitions.csv +++ b/libraries/ESP32/examples/Camera/CameraWebServer/partitions.csv @@ -1,5 +1,6 @@ # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, -app0, app, ota_0, 0x10000, 0x3d0000, -fr, data, , 0x3e0000, 0x20000, +app0, app, ota_0, 0x10000, 0x3c0000, +fr, data, , 0x3d0000, 0x20000, +coredump, data, coredump,0x3f0000, 0x10000, From 9b5405d877e0675f090f1872cf06d6b36729abcc Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 1 Oct 2024 15:43:05 +0300 Subject: [PATCH 6/7] fix(psram): Do not abort if PSRAM is not found Also add to heap in app_main --- cores/esp32/esp32-hal-misc.c | 8 +++++++- cores/esp32/esp32-hal-psram.c | 18 +++++++++++++----- cores/esp32/esp32-hal-psram.h | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/cores/esp32/esp32-hal-misc.c b/cores/esp32/esp32-hal-misc.c index d3782c39aa3..1fb1d2af9df 100644 --- a/cores/esp32/esp32-hal-misc.c +++ b/cores/esp32/esp32-hal-misc.c @@ -255,7 +255,8 @@ extern bool btInUse(); #if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM #ifndef CONFIG_SPIRAM_BOOT_INIT ESP_SYSTEM_INIT_FN(init_psram_new, CORE, BIT(0), 99) { - return psramInit() ? ESP_OK : ESP_FAIL; + psramInit(); + return ESP_OK; } #endif #endif @@ -263,6 +264,11 @@ ESP_SYSTEM_INIT_FN(init_psram_new, CORE, BIT(0), 99) { void initArduino() { //init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz) //ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1; +#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM +#ifndef CONFIG_SPIRAM_BOOT_INIT + psramAddToHeap(); +#endif +#endif #ifdef CONFIG_APP_ROLLBACK_ENABLE if (!verifyRollbackLater()) { const esp_partition_t *running = esp_ota_get_running_partition(); diff --git a/cores/esp32/esp32-hal-psram.c b/cores/esp32/esp32-hal-psram.c index d2c5ab96fc3..6b0b631791b 100644 --- a/cores/esp32/esp32-hal-psram.c +++ b/cores/esp32/esp32-hal-psram.c @@ -81,17 +81,25 @@ bool psramInit() { ESP_EARLY_LOGE(TAG, "PSRAM test failed!"); return false; } + ESP_EARLY_LOGI(TAG, "PSRAM enabled"); +#endif /* CONFIG_SPIRAM_BOOT_INIT */ + spiramDetected = true; + return true; +} + +bool psramAddToHeap() { + if (!spiramDetected) { + log_e("PSRAM not initialized!"); + return false; + } if (esp_psram_extram_add_to_heap_allocator() != ESP_OK) { - spiramFailed = true; - ESP_EARLY_LOGE(TAG, "PSRAM could not be added to the heap!"); + log_e("PSRAM could not be added to the heap!"); return false; } #if CONFIG_SPIRAM_USE_MALLOC && !CONFIG_ARDUINO_ISR_IRAM heap_caps_malloc_extmem_enable(CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL); #endif - ESP_EARLY_LOGI(TAG, "PSRAM enabled"); -#endif /* CONFIG_SPIRAM_BOOT_INIT */ - spiramDetected = true; + log_i("PSRAM added to the heap."); return true; } diff --git a/cores/esp32/esp32-hal-psram.h b/cores/esp32/esp32-hal-psram.h index 0ba6763c69f..e82af1342c2 100644 --- a/cores/esp32/esp32-hal-psram.h +++ b/cores/esp32/esp32-hal-psram.h @@ -31,6 +31,7 @@ extern "C" { #endif bool psramInit(); +bool psramAddToHeap(); bool psramFound(); void *ps_malloc(size_t size); From f738a31cce075b05ca42f88575a2869bb1bdda58 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 1 Oct 2024 16:11:59 +0300 Subject: [PATCH 7/7] fix(psram): ESP32-S2 does not like to early debug log --- cores/esp32/esp32-hal-psram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-psram.c b/cores/esp32/esp32-hal-psram.c index 6b0b631791b..3c7a51c3343 100644 --- a/cores/esp32/esp32-hal-psram.c +++ b/cores/esp32/esp32-hal-psram.c @@ -81,7 +81,7 @@ bool psramInit() { ESP_EARLY_LOGE(TAG, "PSRAM test failed!"); return false; } - ESP_EARLY_LOGI(TAG, "PSRAM enabled"); + //ESP_EARLY_LOGI(TAG, "PSRAM enabled"); #endif /* CONFIG_SPIRAM_BOOT_INIT */ spiramDetected = true; return true;