mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-30 08:51:19 +01:00
pkg/esp32_sdk: add patches for ESP-IDF v5.4
This commit is contained in:
parent
5013610de5
commit
ea0e50d64e
@ -0,0 +1,30 @@
|
||||
From b21ceb6f079a63d05552831d372de5d8bbda1173 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Mon, 20 Jan 2025 21:49:10 +0100
|
||||
Subject: [PATCH 01/28] compilation: avoid multiple definitions of macros
|
||||
|
||||
---
|
||||
components/xtensa/include/xtensa/xtruntime-frames.h | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/components/xtensa/include/xtensa/xtruntime-frames.h b/components/xtensa/include/xtensa/xtruntime-frames.h
|
||||
index b78095e0dd..4a5b4d356a 100644
|
||||
--- a/components/xtensa/include/xtensa/xtruntime-frames.h
|
||||
+++ b/components/xtensa/include/xtensa/xtruntime-frames.h
|
||||
@@ -29,6 +29,13 @@
|
||||
|
||||
#include <xtensa/config/core.h>
|
||||
|
||||
+#ifdef STRUCT_BEGIN
|
||||
+#undef STRUCT_BEGIN
|
||||
+#undef STRUCT_FIELD
|
||||
+#undef STRUCT_AFIELD
|
||||
+#undef STRUCT_END
|
||||
+#endif
|
||||
+
|
||||
/* Macros that help define structures for both C and assembler: */
|
||||
#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__)
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
From 76a15bfad81c3cd6b31222f8afdc050a69276170 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:32:12 +0100
|
||||
Subject: [PATCH 03/28] wpa_supplicant: use ztimer_sleep in os_sleep
|
||||
|
||||
---
|
||||
components/wpa_supplicant/port/os_xtensa.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/wpa_supplicant/port/os_xtensa.c b/components/wpa_supplicant/port/os_xtensa.c
|
||||
index 7a2309e8b5..57e16ddc6a 100644
|
||||
--- a/components/wpa_supplicant/port/os_xtensa.c
|
||||
+++ b/components/wpa_supplicant/port/os_xtensa.c
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "utils/common.h"
|
||||
#include "mbedtls/platform_util.h"
|
||||
|
||||
+#include "ztimer.h"
|
||||
+
|
||||
int os_get_time(struct os_time *t)
|
||||
{
|
||||
struct timeval tv;
|
||||
@@ -53,10 +55,10 @@ int os_get_random(unsigned char *buf, size_t len)
|
||||
void os_sleep(os_time_t sec, os_time_t usec)
|
||||
{
|
||||
if (sec) {
|
||||
- sleep(sec);
|
||||
+ ztimer_sleep(ZTIMER_SEC, sec);
|
||||
}
|
||||
if (usec) {
|
||||
- usleep(usec);
|
||||
+ ztimer_sleep(ZTIMER_USEC, usec);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From cd2cadff0a0a1fcb4cfdbd802989934d3b15a22e Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:33:00 +0100
|
||||
Subject: [PATCH 04/28] wpa_supplicant: conditional include for mbedtls
|
||||
|
||||
---
|
||||
components/wpa_supplicant/port/os_xtensa.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/wpa_supplicant/port/os_xtensa.c b/components/wpa_supplicant/port/os_xtensa.c
|
||||
index 57e16ddc6a..7e5d78bd70 100644
|
||||
--- a/components/wpa_supplicant/port/os_xtensa.c
|
||||
+++ b/components/wpa_supplicant/port/os_xtensa.c
|
||||
@@ -28,7 +28,9 @@
|
||||
#include <sys/time.h>
|
||||
#include "esp_random.h"
|
||||
#include "utils/common.h"
|
||||
+#if USE_MBEDTLS_CRYPTO
|
||||
#include "mbedtls/platform_util.h"
|
||||
+#endif
|
||||
|
||||
#include "ztimer.h"
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
From e3f73720b24abaa73b6f818c954b6dbdc0d879b3 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:38:43 +0100
|
||||
Subject: [PATCH 05/28] wpa_suppplicant: avoid conflicts for ARRAY_SIZE macro
|
||||
|
||||
---
|
||||
components/wpa_supplicant/src/utils/common.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/components/wpa_supplicant/src/utils/common.h b/components/wpa_supplicant/src/utils/common.h
|
||||
index 998870e90f..8f01822939 100644
|
||||
--- a/components/wpa_supplicant/src/utils/common.h
|
||||
+++ b/components/wpa_supplicant/src/utils/common.h
|
||||
@@ -449,7 +449,10 @@ struct wpa_freq_range_list {
|
||||
unsigned int num;
|
||||
};
|
||||
|
||||
+#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
+#endif
|
||||
+
|
||||
#ifndef TEST_FAIL
|
||||
#define TEST_FAIL() 0
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,375 @@
|
||||
From 2273125f8cc71c1e03be9f199dfba6d94a82aeb5 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:38:07 +0100
|
||||
Subject: [PATCH 06/28] bootloader: allow compilation for RIOT-OS
|
||||
|
||||
---
|
||||
.../subproject/main/ld/esp32/bootloader.ld | 58 ++++++++---------
|
||||
.../subproject/main/ld/esp32c3/bootloader.ld | 58 ++++++++---------
|
||||
.../subproject/main/ld/esp32s2/bootloader.ld | 62 +++++++++----------
|
||||
.../subproject/main/ld/esp32s3/bootloader.ld | 60 +++++++++---------
|
||||
components/log/include/esp_log.h | 4 ++
|
||||
components/log/include/esp_log_buffer.h | 4 ++
|
||||
components/log/include/esp_log_color.h | 2 +
|
||||
7 files changed, 129 insertions(+), 119 deletions(-)
|
||||
|
||||
diff --git a/components/bootloader/subproject/main/ld/esp32/bootloader.ld b/components/bootloader/subproject/main/ld/esp32/bootloader.ld
|
||||
index d5fb575ddd..97bb99b8a6 100644
|
||||
--- a/components/bootloader/subproject/main/ld/esp32/bootloader.ld
|
||||
+++ b/components/bootloader/subproject/main/ld/esp32/bootloader.ld
|
||||
@@ -41,38 +41,38 @@ SECTIONS
|
||||
_loader_text_start = ABSOLUTE(.);
|
||||
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
|
||||
- *liblog.a:(.literal .text .literal.* .text.*)
|
||||
+ *components/log/*(.literal .text .literal.* .text.*)
|
||||
/* we use either libgcc or compiler-rt, so put similar entries for them here */
|
||||
*libgcc.a:(.literal .text .literal.* .text.*)
|
||||
*libclang_rt.builtins.a:(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
- *libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
- *libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
- *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
- *libefuse.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_rom.a:*.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
+ *components/esp_system/fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
+ *components/bootloader_support/*/bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/*/micro-ecc/*(.literal .text .literal.* .text.*)
|
||||
+ *components/spi_flash/*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_time.*(.literal .text .literal.* .text.*)
|
||||
+ *components/efuse/*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_rom/*/*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
diff --git a/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld
|
||||
index 21f19c14fe..0a7a2d32dc 100644
|
||||
--- a/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld
|
||||
+++ b/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld
|
||||
@@ -62,38 +62,38 @@ SECTIONS
|
||||
_loader_text_start = ABSOLUTE(.);
|
||||
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
|
||||
- *liblog.a:(.literal .text .literal.* .text.*)
|
||||
+ *components/log/*(.literal .text .literal.* .text.*)
|
||||
/* we use either libgcc or compiler-rt, so put similar entries for them here */
|
||||
*libgcc.a:(.literal .text .literal.* .text.*)
|
||||
*libclang_rt.builtins.a:(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
- *libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
- *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:cache_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
- *libefuse.a:*.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
+ *components/bootloader_support/*/bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/*/micro-ecc/*(.literal .text .literal.* .text.*)
|
||||
+ *components/spi_flash/*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/cache_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_time.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
+ *components/efuse/*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
diff --git a/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld b/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld
|
||||
index f2c4ede304..d26362429e 100644
|
||||
--- a/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld
|
||||
+++ b/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld
|
||||
@@ -28,40 +28,40 @@ SECTIONS
|
||||
_loader_text_start = ABSOLUTE(.);
|
||||
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
|
||||
- *liblog.a:(.literal .text .literal.* .text.*)
|
||||
+ *components/log/*(.literal .text .literal.* .text.*)
|
||||
/* we use either libgcc or compiler-rt, so put similar entries for them here */
|
||||
*libgcc.a:(.literal .text .literal.* .text.*)
|
||||
*libclang_rt.builtins.a:(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
- *libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
- *libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
- *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:cache_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
- *libefuse.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_rom.a:esp_rom_regi2c.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
+ *components/esp_system/fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
+ *components/bootloader_support/*/bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/*/micro-ecc/*(.literal .text .literal.* .text.*)
|
||||
+ *components/spi_flash/*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/cache_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_time.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
+ *components/efuse/*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_rom/*/esp_rom_regi2c.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
diff --git a/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld b/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld
|
||||
index c0f4702a01..e57c49c434 100644
|
||||
--- a/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld
|
||||
+++ b/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld
|
||||
@@ -63,39 +63,39 @@ SECTIONS
|
||||
_loader_text_start = ABSOLUTE(.);
|
||||
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
|
||||
- *liblog.a:(.literal .text .literal.* .text.*)
|
||||
+ *components/log/*(.literal .text .literal.* .text.*)
|
||||
/* we use either libgcc or compiler-rt, so put similar entries for them here */
|
||||
*libgcc.a:(.literal .text .literal.* .text.*)
|
||||
*libclang_rt.builtins.a:(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
- *libesp_common.a:fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
- *libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
- *libbootloader_support.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
- *libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:cache_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
- *libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
- *libefuse.a:*.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
+ *components/esp_system/fpga_overrides.*(.literal.bootloader_fill_random .text.bootloader_fill_random)
|
||||
+ *components/bootloader_support/*/bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
+ *components/bootloader_support/*/secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
+ *components/*/micro-ecc/*(.literal .text .literal.* .text.*)
|
||||
+ *components/spi_flash/*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/cache_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/hal/efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/*/rtc_time.*(.literal .text .literal.* .text.*)
|
||||
+ *components/esp_hw_support/regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
+ *components/efuse/*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
diff --git a/components/log/include/esp_log.h b/components/log/include/esp_log.h
|
||||
index e2cb068f43..eb6d94acad 100644
|
||||
--- a/components/log/include/esp_log.h
|
||||
+++ b/components/log/include/esp_log.h
|
||||
@@ -59,6 +59,8 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
|
||||
|
||||
/** @cond */
|
||||
|
||||
+#if !defined(RIOT_VERSION) || defined(BOOTLOADER_BUILD)
|
||||
+
|
||||
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
|
||||
#define LOG_SYSTEM_TIME_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%s) %s: " format LOG_RESET_COLOR "\n"
|
||||
|
||||
@@ -259,6 +261,8 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
|
||||
#endif // !(defined(__cplusplus) && (__cplusplus > 201703L))
|
||||
/** @endcond */
|
||||
|
||||
+#endif /* !defined(RIOT_VERSION) || defined(BOOTLOADER_BUILD) */
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
diff --git a/components/log/include/esp_log_buffer.h b/components/log/include/esp_log_buffer.h
|
||||
index 5453061403..603a3c5b3b 100644
|
||||
--- a/components/log/include/esp_log_buffer.h
|
||||
+++ b/components/log/include/esp_log_buffer.h
|
||||
@@ -63,6 +63,8 @@ void esp_log_buffer_char_internal(const char *tag, const void *buffer, uint16_t
|
||||
*/
|
||||
void esp_log_buffer_hexdump_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t log_level);
|
||||
|
||||
+#if !defined(RIOT_VERSION) || defined(BOOTLOADER_BUILD)
|
||||
+
|
||||
/**
|
||||
* @brief Log a buffer of hex bytes at specified level, separated into 16 bytes each line.
|
||||
*
|
||||
@@ -173,6 +175,8 @@ static inline void esp_log_buffer_char(const char *tag, const void *buffer, uint
|
||||
}
|
||||
/** @endcond */
|
||||
|
||||
+#endif /* !defined(RIOT_VERSION) || defined(BOOTLOADER_BUILD) */
|
||||
+
|
||||
#endif // !NON_OS_BUILD || __DOXYGEN__
|
||||
|
||||
#ifdef __cplusplus
|
||||
diff --git a/components/log/include/esp_log_color.h b/components/log/include/esp_log_color.h
|
||||
index 483d634ea6..dde406a526 100644
|
||||
--- a/components/log/include/esp_log_color.h
|
||||
+++ b/components/log/include/esp_log_color.h
|
||||
@@ -94,12 +94,14 @@ extern "C" {
|
||||
#define LOG_COLOR_D ""
|
||||
#define LOG_COLOR_V ""
|
||||
#else
|
||||
+#if !defined(RIOT_VERSION) || defined(BOOTLOADER_BUILD)
|
||||
#define LOG_RESET_COLOR ""
|
||||
#define LOG_COLOR_E ""
|
||||
#define LOG_COLOR_W ""
|
||||
#define LOG_COLOR_I ""
|
||||
#define LOG_COLOR_D ""
|
||||
#define LOG_COLOR_V ""
|
||||
+#endif /* !defined(RIOT_VERSION) || defined(BOOTLOADER_BUILD) */
|
||||
#endif
|
||||
/** @endcond */
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
From b63a8db9ecc824fd05ab19b51fbc7c217234e582 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:40:10 +0100
|
||||
Subject: [PATCH 07/28] sdmmc: avoid type definition conflicts
|
||||
|
||||
---
|
||||
components/sdmmc/include/sd_protocol_types.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/components/sdmmc/include/sd_protocol_types.h b/components/sdmmc/include/sd_protocol_types.h
|
||||
index 70cdf76d12..41fac5d339 100644
|
||||
--- a/components/sdmmc/include/sd_protocol_types.h
|
||||
+++ b/components/sdmmc/include/sd_protocol_types.h
|
||||
@@ -34,6 +34,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#if !defined(RIOT_VERSION)
|
||||
/**
|
||||
* Decoded values from SD card Card Specific Data register
|
||||
*/
|
||||
@@ -96,6 +97,8 @@ typedef struct {
|
||||
uint8_t sec_feature; /*!< secure data management features supported by the card */
|
||||
} sdmmc_ext_csd_t;
|
||||
|
||||
+#endif /* !defined(RIOT_VERSION) */
|
||||
+
|
||||
/**
|
||||
* SD/MMC command response buffer
|
||||
*/
|
||||
@@ -245,6 +248,7 @@ typedef struct {
|
||||
esp_err_t (*is_slot_set_to_uhs1)(int slot, bool *is_uhs1); /*!< host slot is set to uhs1 or not*/
|
||||
} sdmmc_host_t;
|
||||
|
||||
+#if !defined(RIOT_VERSION)
|
||||
/**
|
||||
* SD/MMC card information structure
|
||||
*/
|
||||
@@ -273,6 +277,8 @@ typedef struct {
|
||||
uint32_t reserved : 22; /*!< Reserved for future expansion */
|
||||
} sdmmc_card_t;
|
||||
|
||||
+#endif /* !defined(RIOT_VERSION) */
|
||||
+
|
||||
/**
|
||||
* SD/MMC erase command(38) arguments
|
||||
* SD:
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
From 97e5f240e60ca9d7806f9e4ed53ac1c025e8ce87 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:55:31 +0100
|
||||
Subject: [PATCH 08/28] sdmmc: fix byte-wise writing to CMD register
|
||||
|
||||
Writing the 32-bit CMD register using memcpy results in the register being written byte by byte in any order. If the start bit in the CMD register is set before all bytes have been written, a wrong command is executed. Writing to the 32-bit CMD register must be performed as a single word register copy instruction which is guaranteed by the assignment.
|
||||
---
|
||||
components/hal/esp32/include/hal/sdmmc_ll.h | 2 +-
|
||||
components/hal/esp32s3/include/hal/sdmmc_ll.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/hal/esp32/include/hal/sdmmc_ll.h b/components/hal/esp32/include/hal/sdmmc_ll.h
|
||||
index 0f5a62ea37..feecb231e5 100644
|
||||
--- a/components/hal/esp32/include/hal/sdmmc_ll.h
|
||||
+++ b/components/hal/esp32/include/hal/sdmmc_ll.h
|
||||
@@ -491,7 +491,7 @@ static inline void sdmmc_ll_poll_demand(sdmmc_dev_t *hw)
|
||||
*/
|
||||
static inline void sdmmc_ll_set_command(sdmmc_dev_t *hw, sdmmc_hw_cmd_t cmd)
|
||||
{
|
||||
- memcpy((void *)&hw->cmd, &cmd, sizeof(sdmmc_hw_cmd_t));
|
||||
+ hw->cmd = cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/components/hal/esp32s3/include/hal/sdmmc_ll.h b/components/hal/esp32s3/include/hal/sdmmc_ll.h
|
||||
index 2747905931..60cd5923bd 100644
|
||||
--- a/components/hal/esp32s3/include/hal/sdmmc_ll.h
|
||||
+++ b/components/hal/esp32s3/include/hal/sdmmc_ll.h
|
||||
@@ -527,7 +527,7 @@ static inline void sdmmc_ll_poll_demand(sdmmc_dev_t *hw)
|
||||
*/
|
||||
static inline void sdmmc_ll_set_command(sdmmc_dev_t *hw, sdmmc_hw_cmd_t cmd)
|
||||
{
|
||||
- memcpy((void *)&hw->cmd, &cmd, sizeof(sdmmc_hw_cmd_t));
|
||||
+ hw->cmd = cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From 321ef67c4675f566dcbe885558ece59e3a4f3845 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:56:30 +0100
|
||||
Subject: [PATCH 09/28] bt/controller: fix printf format string
|
||||
|
||||
---
|
||||
components/bt/controller/esp32/bt.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/bt/controller/esp32/bt.c b/components/bt/controller/esp32/bt.c
|
||||
index d94c9c0507..6a20c2b1b7 100644
|
||||
--- a/components/bt/controller/esp32/bt.c
|
||||
+++ b/components/bt/controller/esp32/bt.c
|
||||
@@ -1273,7 +1273,7 @@ static void btdm_controller_mem_init(void)
|
||||
{
|
||||
/* initialise .data section */
|
||||
memcpy(&_data_start_btdm, (void *)_data_start_btdm_rom, &_data_end_btdm - &_data_start_btdm);
|
||||
- ESP_LOGD(BTDM_LOG_TAG, ".data initialise [0x%08x] <== [0x%08x]", (uint32_t)&_data_start_btdm, _data_start_btdm_rom);
|
||||
+ ESP_LOGD(BTDM_LOG_TAG, ".data initialise [0x%08"PRIx32"] <== [0x%08"PRIx32"]", (uint32_t)&_data_start_btdm, _data_start_btdm_rom);
|
||||
|
||||
//initial em, .bss section
|
||||
for (int i = 1; i < sizeof(btdm_dram_available_region)/sizeof(btdm_dram_available_region_t); i++) {
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From b0a8bfb89d5f80f951cfa9f57e128c90940d0523 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:57:00 +0100
|
||||
Subject: [PATCH 10/28] bt/controller: add missing includes
|
||||
|
||||
---
|
||||
components/bt/controller/esp32c3/bt.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c
|
||||
index 19eea2ee87..90123c47cd 100644
|
||||
--- a/components/bt/controller/esp32c3/bt.c
|
||||
+++ b/components/bt/controller/esp32c3/bt.c
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_pm.h"
|
||||
+#include "esp_intr_types.h"
|
||||
+#include "esp_intr_alloc.h"
|
||||
#include "esp_ipc.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "esp_private/esp_clk.h"
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
From fb8d63941e9ae075cdcd9dddab01716b01e54ee8 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:57:26 +0100
|
||||
Subject: [PATCH 11/28] esp_wifi: add missing includes
|
||||
|
||||
---
|
||||
components/esp_wifi/esp32/esp_adapter.c | 1 +
|
||||
components/esp_wifi/esp32c3/esp_adapter.c | 1 +
|
||||
components/esp_wifi/esp32s2/esp_adapter.c | 1 +
|
||||
components/esp_wifi/esp32s3/esp_adapter.c | 1 +
|
||||
4 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/components/esp_wifi/esp32/esp_adapter.c b/components/esp_wifi/esp32/esp_adapter.c
|
||||
index 3d69706012..92795986d8 100644
|
||||
--- a/components/esp_wifi/esp32/esp_adapter.c
|
||||
+++ b/components/esp_wifi/esp32/esp_adapter.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "esp_cpu.h"
|
||||
#include "esp_private/wifi_os_adapter.h"
|
||||
#include "esp_private/wifi.h"
|
||||
+#include "esp_system.h"
|
||||
#ifdef CONFIG_ESP_PHY_ENABLED
|
||||
#include "esp_phy_init.h"
|
||||
#include "phy_init_data.h"
|
||||
diff --git a/components/esp_wifi/esp32c3/esp_adapter.c b/components/esp_wifi/esp32c3/esp_adapter.c
|
||||
index 7c72f19c9f..59e69b3d78 100644
|
||||
--- a/components/esp_wifi/esp32c3/esp_adapter.c
|
||||
+++ b/components/esp_wifi/esp32c3/esp_adapter.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "esp_timer.h"
|
||||
#include "esp_private/wifi_os_adapter.h"
|
||||
#include "esp_private/wifi.h"
|
||||
+#include "esp_system.h"
|
||||
#ifdef CONFIG_ESP_PHY_ENABLED
|
||||
#include "esp_phy_init.h"
|
||||
#include "phy_init_data.h"
|
||||
diff --git a/components/esp_wifi/esp32s2/esp_adapter.c b/components/esp_wifi/esp32s2/esp_adapter.c
|
||||
index 725a553dba..7358e324d6 100644
|
||||
--- a/components/esp_wifi/esp32s2/esp_adapter.c
|
||||
+++ b/components/esp_wifi/esp32s2/esp_adapter.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "esp_cpu.h"
|
||||
#include "esp_private/wifi_os_adapter.h"
|
||||
#include "esp_private/wifi.h"
|
||||
+#include "esp_system.h"
|
||||
#ifdef CONFIG_ESP_PHY_ENABLED
|
||||
#include "esp_phy_init.h"
|
||||
#include "phy_init_data.h"
|
||||
diff --git a/components/esp_wifi/esp32s3/esp_adapter.c b/components/esp_wifi/esp32s3/esp_adapter.c
|
||||
index 1e00fbbedb..faa5da1018 100644
|
||||
--- a/components/esp_wifi/esp32s3/esp_adapter.c
|
||||
+++ b/components/esp_wifi/esp32s3/esp_adapter.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "esp_cpu.h"
|
||||
#include "esp_private/wifi_os_adapter.h"
|
||||
#include "esp_private/wifi.h"
|
||||
+#include "esp_system.h"
|
||||
#ifdef CONFIG_ESP_PHY_ENABLED
|
||||
#include "esp_phy_init.h"
|
||||
#include "phy_init_data.h"
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
From f230a2601a0ff9cb47fe128015e6ef8e61baab1e Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:58:33 +0100
|
||||
Subject: [PATCH 12/28] esp_eth: add missing includes
|
||||
|
||||
---
|
||||
components/esp_eth/include/esp_eth_mac_esp.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/components/esp_eth/include/esp_eth_mac_esp.h b/components/esp_eth/include/esp_eth_mac_esp.h
|
||||
index f18bf4d75c..1cbcc52730 100644
|
||||
--- a/components/esp_eth/include/esp_eth_mac_esp.h
|
||||
+++ b/components/esp_eth/include/esp_eth_mac_esp.h
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
+#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include "soc/soc_caps.h"
|
||||
#include "esp_eth_com.h"
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
From 83210f57c6d79b124b0644969f6aec92f04c1189 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:59:14 +0100
|
||||
Subject: [PATCH 13/28] esp_hw_support: add missing includes
|
||||
|
||||
---
|
||||
components/esp_hw_support/sleep_modes.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c
|
||||
index 3a5944bc23..207c173449 100644
|
||||
--- a/components/esp_hw_support/sleep_modes.c
|
||||
+++ b/components/esp_hw_support/sleep_modes.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "esp_attr.h"
|
||||
+#include "esp_cpu.h"
|
||||
#include "esp_rom_caps.h"
|
||||
#include "esp_macros.h"
|
||||
#include "esp_memory_utils.h"
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
From a1a7998e4905862ed8a9e22c4bc704877bbf23ac Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 18:02:34 +0100
|
||||
Subject: [PATCH 14/28] esp_phy: add missing includes
|
||||
|
||||
---
|
||||
components/esp_phy/src/phy_init.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c
|
||||
index bc8d28bf3f..5d6d3cc525 100644
|
||||
--- a/components/esp_phy/src/phy_init.c
|
||||
+++ b/components/esp_phy/src/phy_init.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "esp_private/wifi.h"
|
||||
#include "esp_rom_crc.h"
|
||||
#include "esp_rom_sys.h"
|
||||
+#include "esp_system.h"
|
||||
|
||||
#include "soc/rtc_periph.h"
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
From f504db165a55f83e9d253194a1b880b2a5f746c4 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 18:03:20 +0100
|
||||
Subject: [PATCH 15/28] hal: fix signed/unsigned comparison
|
||||
|
||||
---
|
||||
components/hal/esp32c3/include/hal/gpspi_flash_ll.h | 2 +-
|
||||
components/hal/esp32c3/include/hal/spimem_flash_ll.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/hal/esp32c3/include/hal/gpspi_flash_ll.h b/components/hal/esp32c3/include/hal/gpspi_flash_ll.h
|
||||
index 18465d85f1..2d2934b97d 100644
|
||||
--- a/components/hal/esp32c3/include/hal/gpspi_flash_ll.h
|
||||
+++ b/components/hal/esp32c3/include/hal/gpspi_flash_ll.h
|
||||
@@ -85,7 +85,7 @@ static inline void gpspi_flash_ll_get_buffer_data(spi_dev_t *dev, void *buffer,
|
||||
} else {
|
||||
// Otherwise, slow(er) path copies word by word
|
||||
int copy_len = read_len;
|
||||
- for (int i = 0; i < (read_len + 3) / 4; i++) {
|
||||
+ for (uint32_t i = 0; i < (read_len + 3) / 4; i++) {
|
||||
int word_len = MIN(sizeof(uint32_t), copy_len);
|
||||
uint32_t word = dev->data_buf[i];
|
||||
memcpy(buffer, &word, word_len);
|
||||
diff --git a/components/hal/esp32c3/include/hal/spimem_flash_ll.h b/components/hal/esp32c3/include/hal/spimem_flash_ll.h
|
||||
index fd9bc38ed9..c643919bb0 100644
|
||||
--- a/components/hal/esp32c3/include/hal/spimem_flash_ll.h
|
||||
+++ b/components/hal/esp32c3/include/hal/spimem_flash_ll.h
|
||||
@@ -332,7 +332,7 @@ static inline void spimem_flash_ll_get_buffer_data(spi_mem_dev_t *dev, void *buf
|
||||
} else {
|
||||
// Otherwise, slow(er) path copies word by word
|
||||
int copy_len = read_len;
|
||||
- for (int i = 0; i < (read_len + 3) / 4; i++) {
|
||||
+ for (uint32_t i = 0; i < (read_len + 3) / 4; i++) {
|
||||
int word_len = MIN(sizeof(uint32_t), copy_len);
|
||||
uint32_t word = dev->data_buf[i];
|
||||
memcpy(buffer, &word, word_len);
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 9220ae3c3d5bf30804f6741c43b753317d3486ef Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 18:04:05 +0100
|
||||
Subject: [PATCH 16/28] hal/gpio_types: avoid type conflicts with RIOT gpio
|
||||
types
|
||||
|
||||
---
|
||||
components/hal/include/hal/gpio_types.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/components/hal/include/hal/gpio_types.h b/components/hal/include/hal/gpio_types.h
|
||||
index d785ec491a..1a60a4181c 100644
|
||||
--- a/components/hal/include/hal/gpio_types.h
|
||||
+++ b/components/hal/include/hal/gpio_types.h
|
||||
@@ -14,10 +14,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#ifndef HAVE_GPIO_PORT_T
|
||||
typedef enum {
|
||||
GPIO_PORT_0 = 0,
|
||||
GPIO_PORT_MAX,
|
||||
} gpio_port_t;
|
||||
+#endif
|
||||
|
||||
#define GPIO_PIN_REG_0 IO_MUX_GPIO0_REG
|
||||
#define GPIO_PIN_REG_1 IO_MUX_GPIO1_REG
|
||||
@@ -92,6 +94,7 @@ typedef enum {
|
||||
#define GPIO_MODE_DEF_OD (BIT2) ///< bit mask for OD mode
|
||||
/** @endcond */
|
||||
|
||||
+#ifndef HAVE_GPIO_MODE_T
|
||||
typedef enum {
|
||||
GPIO_MODE_DISABLE = GPIO_MODE_DEF_DISABLE, /*!< GPIO mode : disable input and output */
|
||||
GPIO_MODE_INPUT = GPIO_MODE_DEF_INPUT, /*!< GPIO mode : input only */
|
||||
@@ -100,6 +103,7 @@ typedef enum {
|
||||
GPIO_MODE_INPUT_OUTPUT_OD = ((GPIO_MODE_DEF_INPUT) | (GPIO_MODE_DEF_OUTPUT) | (GPIO_MODE_DEF_OD)), /*!< GPIO mode : output and input with open-drain mode*/
|
||||
GPIO_MODE_INPUT_OUTPUT = ((GPIO_MODE_DEF_INPUT) | (GPIO_MODE_DEF_OUTPUT)), /*!< GPIO mode : output and input mode */
|
||||
} gpio_mode_t;
|
||||
+#endif
|
||||
|
||||
typedef enum {
|
||||
GPIO_PULLUP_DISABLE = 0x0, /*!< Disable GPIO pull-up resistor */
|
||||
@@ -111,12 +115,14 @@ typedef enum {
|
||||
GPIO_PULLDOWN_ENABLE = 0x1, /*!< Enable GPIO pull-down resistor */
|
||||
} gpio_pulldown_t;
|
||||
|
||||
+#ifndef HAVE_GPIO_PULL_T
|
||||
typedef enum {
|
||||
GPIO_PULLUP_ONLY, /*!< Pad pull up */
|
||||
GPIO_PULLDOWN_ONLY, /*!< Pad pull down */
|
||||
GPIO_PULLUP_PULLDOWN, /*!< Pad pull up + pull down*/
|
||||
GPIO_FLOATING, /*!< Pad floating */
|
||||
} gpio_pull_mode_t;
|
||||
+#endif
|
||||
|
||||
typedef enum {
|
||||
GPIO_DRIVE_CAP_0 = 0, /*!< Pad drive capability: weak */
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
From d1d459905d7152eb1ff065ea80dd73e384c7ff7b Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 18:04:52 +0100
|
||||
Subject: [PATCH 17/28] hal: avoid conflicts for ARRAY_SIZE macro
|
||||
|
||||
---
|
||||
components/hal/esp32s3/include/hal/mspi_timing_tuning_ll.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/components/hal/esp32s3/include/hal/mspi_timing_tuning_ll.h b/components/hal/esp32s3/include/hal/mspi_timing_tuning_ll.h
|
||||
index 9ba2778472..c740e8d0cf 100644
|
||||
--- a/components/hal/esp32s3/include/hal/mspi_timing_tuning_ll.h
|
||||
+++ b/components/hal/esp32s3/include/hal/mspi_timing_tuning_ll.h
|
||||
@@ -25,7 +25,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(arr) (sizeof((arr))/sizeof(*(arr)))
|
||||
+#endif
|
||||
+
|
||||
#define MSPI_TIMING_LL_FLASH_OCT_MASK (SPI_MEM_FCMD_OCT | SPI_MEM_FADDR_OCT | SPI_MEM_FDIN_OCT | SPI_MEM_FDOUT_OCT)
|
||||
#define MSPI_TIMING_LL_FLASH_QUAD_MASK (SPI_MEM_FASTRD_MODE | SPI_MEM_FREAD_DUAL | SPI_MEM_FREAD_DIO | SPI_MEM_FREAD_QUAD | SPI_MEM_FREAD_QIO)
|
||||
#define MSPI_TIMING_LL_FLASH_QIO_MODE_MASK (SPI_MEM_FREAD_QIO | SPI_MEM_FASTRD_MODE)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
From 0065ed08bb49264552b1f966196736872e27eba2 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 18:28:29 +0100
|
||||
Subject: [PATCH 18/28] freertos/portasm: changes for RIOT for riscv32
|
||||
|
||||
---
|
||||
.../FreeRTOS-Kernel/portable/riscv/portasm.S | 33 ++++++++++++++++---
|
||||
1 file changed, 28 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S
|
||||
index 5f32c613a0..f6ba4eb72b 100644
|
||||
--- a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S
|
||||
+++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S
|
||||
@@ -4,17 +4,30 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
-#include "portmacro.h"
|
||||
-#include "freertos/FreeRTOSConfig.h"
|
||||
#include "soc/soc_caps.h"
|
||||
-#include "riscv/rvruntime-frames.h"
|
||||
-#include "riscv/csr_hwlp.h"
|
||||
-#include "riscv/csr_pie.h"
|
||||
|
||||
.extern pxCurrentTCBs
|
||||
|
||||
#if CONFIG_ESP_SYSTEM_HW_STACK_GUARD
|
||||
#include "esp_private/hw_stack_guard.h"
|
||||
+#endif
|
||||
+
|
||||
+#ifdef RIOT_VERSION
|
||||
+#include "cpu_conf.h"
|
||||
+
|
||||
+#define port_uxInterruptNesting irq_interrupt_nesting
|
||||
+#define port_xSchedulerRunning sched_num_threads
|
||||
+#define pxCurrentTCB sched_active_thread
|
||||
+#define pxCurrentTCBs sched_active_thread
|
||||
+#define vTaskSwitchContext sched_run
|
||||
+#define xPortSwitchFlag sched_context_switch_request
|
||||
+
|
||||
+#define configISR_STACK_SIZE ESP_ISR_STACKSIZE
|
||||
+
|
||||
+.extern sched_active_thread
|
||||
+.extern sched_num_threads
|
||||
+.extern sched_context_switch_request
|
||||
+.extern irq_interrupt_nesting
|
||||
#endif
|
||||
|
||||
.global port_uxInterruptNesting
|
||||
@@ -30,6 +43,14 @@
|
||||
.global esp_hw_stack_guard_set_bounds
|
||||
#endif /* CONFIG_ESP_SYSTEM_HW_STACK_GUARD */
|
||||
|
||||
+ .data
|
||||
+ .align 16
|
||||
+ .global port_IntStack
|
||||
+port_IntStack:
|
||||
+ .space configISR_STACK_SIZE
|
||||
+ .global port_IntStackTop
|
||||
+port_IntStackTop:
|
||||
+
|
||||
.section .text
|
||||
|
||||
|
||||
@@ -707,7 +728,9 @@ no_switch_restored:
|
||||
#else
|
||||
/* Recover the stack of next task */
|
||||
lw a0, pxCurrentTCBs
|
||||
+ beq a0, zero, rtos_enter_isr_stack
|
||||
lw sp, 0(a0)
|
||||
+rtos_enter_isr_stack:
|
||||
#endif /* ( configNUM_CORES > 1 ) */
|
||||
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
From 7517fc3cdf4913727dda1a1cad464927d24db7ec Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:20:04 +0100
|
||||
Subject: [PATCH 19/28] heap: IRAM is not used as heap
|
||||
|
||||
RIOT only supports memory as a heap that allows byte access. IRAM only allows word-by-word access.
|
||||
---
|
||||
components/heap/port/esp32/memory_layout.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/heap/port/esp32/memory_layout.c b/components/heap/port/esp32/memory_layout.c
|
||||
index b35d8c1b3e..b6c6d59010 100644
|
||||
--- a/components/heap/port/esp32/memory_layout.c
|
||||
+++ b/components/heap/port/esp32/memory_layout.c
|
||||
@@ -95,6 +95,7 @@ const soc_memory_region_t soc_memory_regions[] = {
|
||||
{ 0x3FFF0000, 0x8000, SOC_MEMORY_TYPE_DIRAM, 0x400A8000,true}, //pool 7 <- can be used for MAC dump
|
||||
{ 0x3FFF8000, 0x4000, SOC_MEMORY_TYPE_DIRAM, 0x400A4000,true}, //pool 6 blk 1 <- can be used as trace memory
|
||||
{ 0x3FFFC000, 0x4000, SOC_MEMORY_TYPE_DIRAM, 0x400A0000,true}, //pool 6 blk 0 <- can be used as trace memory
|
||||
+#if !defined(RIOT_VERSION)
|
||||
{ 0x40070000, 0x8000, SOC_MEMORY_TYPE_IRAM, 0, false}, //pool 0
|
||||
{ 0x40078000, 0x8000, SOC_MEMORY_TYPE_IRAM, 0, false}, //pool 1
|
||||
{ 0x40080000, 0x2000, SOC_MEMORY_TYPE_IRAM, 0, false}, //pool 2-5, mmu page 0
|
||||
@@ -113,6 +114,7 @@ const soc_memory_region_t soc_memory_regions[] = {
|
||||
{ 0x4009A000, 0x2000, SOC_MEMORY_TYPE_IRAM, 0, false}, //pool 2-5, mmu page 13
|
||||
{ 0x4009C000, 0x2000, SOC_MEMORY_TYPE_IRAM, 0, false}, //pool 2-5, mmu page 14
|
||||
{ 0x4009E000, 0x2000, SOC_MEMORY_TYPE_IRAM, 0, false}, //pool 2-5, mmu page 15
|
||||
+#endif
|
||||
#ifdef CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
|
||||
{ SOC_RTC_DRAM_LOW, 0x2000, SOC_MEMORY_TYPE_RTCRAM, 0, false}, //RTC Fast Memory
|
||||
#endif
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From b215127198549f5b1362479c72856fd9c4a75cdb Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:21:03 +0100
|
||||
Subject: [PATCH 20/28] nvs_flash: extern declaration of strlcpy
|
||||
|
||||
---
|
||||
components/nvs_flash/src/nvs_storage.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/nvs_flash/src/nvs_storage.cpp b/components/nvs_flash/src/nvs_storage.cpp
|
||||
index e5db0caefe..4db36cec91 100644
|
||||
--- a/components/nvs_flash/src/nvs_storage.cpp
|
||||
+++ b/components/nvs_flash/src/nvs_storage.cpp
|
||||
@@ -7,6 +7,8 @@
|
||||
#if __has_include(<bsd/string.h>)
|
||||
// for strlcpy
|
||||
#include <bsd/string.h>
|
||||
+#else
|
||||
+extern size_t strlcpy(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef ESP_PLATFORM
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
From f052e96b90746eaffcd9142341136201c080910a Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:22:41 +0100
|
||||
Subject: [PATCH 21/28] newlib: include the newlibc sys/uio.h
|
||||
|
||||
---
|
||||
components/newlib/platform_include/sys/uio.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/components/newlib/platform_include/sys/uio.h b/components/newlib/platform_include/sys/uio.h
|
||||
index 3ff3eba871..5a8652a797 100644
|
||||
--- a/components/newlib/platform_include/sys/uio.h
|
||||
+++ b/components/newlib/platform_include/sys/uio.h
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
+#ifdef RIOT_VERSION
|
||||
+#include_next <sys/uio.h>
|
||||
+#endif /* RIOT_VERSION */
|
||||
+
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 9bb7d4820132d756a37aab8a4a4ea5228d6bf134 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:27:20 +0100
|
||||
Subject: [PATCH 22/28] esp_system: conditional define of
|
||||
esp_get_free_heap_size
|
||||
|
||||
Define the function `esp_get_free_heap_size` in ESP-IDF only if the heap implementation of ESP-IDF is used, that is if module `esp_idf_heap` is enabled. Otherwise, this function is defined in `cpu/esp_common/syscalls.c`.
|
||||
---
|
||||
components/esp_system/port/esp_system_chip.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/esp_system/port/esp_system_chip.c b/components/esp_system/port/esp_system_chip.c
|
||||
index 864c2e4c23..dff4a1bd83 100644
|
||||
--- a/components/esp_system/port/esp_system_chip.c
|
||||
+++ b/components/esp_system/port/esp_system_chip.c
|
||||
@@ -67,6 +67,7 @@ void IRAM_ATTR esp_restart_noos_dig(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef MODULE_ESP_IDF_HEAP
|
||||
uint32_t esp_get_free_heap_size(void)
|
||||
{
|
||||
return heap_caps_get_free_size(MALLOC_CAP_DEFAULT);
|
||||
@@ -76,6 +77,7 @@ uint32_t esp_get_free_internal_heap_size(void)
|
||||
{
|
||||
return heap_caps_get_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
|
||||
}
|
||||
+#endif
|
||||
|
||||
uint32_t esp_get_minimum_free_heap_size(void)
|
||||
{
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From b7bf248a900dff96bd04f655ffeb120847ec2fb7 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:29:08 +0100
|
||||
Subject: [PATCH 23/28] esp_system: conditional define of esp_system_abort
|
||||
|
||||
---
|
||||
components/esp_system/port/esp_system_chip.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/esp_system/port/esp_system_chip.c b/components/esp_system/port/esp_system_chip.c
|
||||
index dff4a1bd83..ce7cb27efb 100644
|
||||
--- a/components/esp_system/port/esp_system_chip.c
|
||||
+++ b/components/esp_system/port/esp_system_chip.c
|
||||
@@ -89,7 +89,9 @@ const char *esp_get_idf_version(void)
|
||||
return IDF_VER;
|
||||
}
|
||||
|
||||
+#ifndef RIOT_VERSION
|
||||
void __attribute__((noreturn)) esp_system_abort(const char *details)
|
||||
{
|
||||
panic_abort(details);
|
||||
}
|
||||
+#endif
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
From b2454c0629b03bb244ea9781f294c4a96b7fd848 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:40:35 +0100
|
||||
Subject: [PATCH 24/28] esp_common: use _Static_assert instead of static_assert
|
||||
|
||||
---
|
||||
components/esp_common/include/esp_assert.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/components/esp_common/include/esp_assert.h b/components/esp_common/include/esp_assert.h
|
||||
index fa54fdbedb..e6a77ae046 100644
|
||||
--- a/components/esp_common/include/esp_assert.h
|
||||
+++ b/components/esp_common/include/esp_assert.h
|
||||
@@ -10,7 +10,11 @@
|
||||
|
||||
/* Since IDF v5.0, C17 standard is used, which supports both _Static_assert and static_assert syntax */
|
||||
/* Please do not use `_Static_assert` for C++ compatibility */
|
||||
+#ifndef RIOT_VERSION
|
||||
#define ESP_STATIC_ASSERT static_assert
|
||||
+#else
|
||||
+#define ESP_STATIC_ASSERT _Static_assert
|
||||
+#endif
|
||||
|
||||
/* Assert at compile time if possible, runtime otherwise */
|
||||
#ifndef __cplusplus
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From d203d26a1c478fb1cec92ed569fec73a89299bd8 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 10:42:40 +0100
|
||||
Subject: [PATCH 25/28] esp_app_format: set app_elf_sha256 in esp_app_desc
|
||||
|
||||
---
|
||||
components/esp_app_format/esp_app_desc.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/esp_app_format/esp_app_desc.c b/components/esp_app_format/esp_app_desc.c
|
||||
index 302250b179..c44b32648b 100644
|
||||
--- a/components/esp_app_format/esp_app_desc.c
|
||||
+++ b/components/esp_app_format/esp_app_desc.c
|
||||
@@ -42,6 +42,8 @@ const __attribute__((weak)) __attribute__((section(".rodata_desc"))) esp_app_de
|
||||
// On Linux we just initialize the hash to some known value for testing
|
||||
#if CONFIG_IDF_TARGET_LINUX
|
||||
.app_elf_sha256 = { 0xDE, 0xAD, 0xBE, 0xEF, 0x47, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B},
|
||||
+#else
|
||||
+ .app_elf_sha256 = { },
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION
|
||||
--
|
||||
2.34.1
|
||||
|
||||
222
pkg/esp32_sdk/patches/0026-esp_hw_support-rename-rtc_init.patch
Normal file
222
pkg/esp32_sdk/patches/0026-esp_hw_support-rename-rtc_init.patch
Normal file
@ -0,0 +1,222 @@
|
||||
From a9b8142108e1d9aa88c7d5b2bc968fbe9a0e4433 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sat, 1 Mar 2025 17:17:13 +0100
|
||||
Subject: [PATCH 26/28] esp_hw_support: rename rtc_init
|
||||
|
||||
Rename `rtc_init` to `rtc_init_module` due to name conflicts with RIOT `periph/rtc` module.
|
||||
---
|
||||
components/esp_hw_support/port/esp32/include/soc/rtc.h | 2 +-
|
||||
components/esp_hw_support/port/esp32/rtc_init.c | 2 +-
|
||||
components/esp_hw_support/port/esp32c2/include/soc/rtc.h | 2 +-
|
||||
components/esp_hw_support/port/esp32c2/rtc_init.c | 2 +-
|
||||
components/esp_hw_support/port/esp32c3/include/soc/rtc.h | 2 +-
|
||||
components/esp_hw_support/port/esp32c3/rtc_init.c | 2 +-
|
||||
components/esp_hw_support/port/esp32s2/include/soc/rtc.h | 2 +-
|
||||
components/esp_hw_support/port/esp32s2/rtc_init.c | 2 +-
|
||||
components/esp_hw_support/port/esp32s3/include/soc/rtc.h | 2 +-
|
||||
components/esp_hw_support/port/esp32s3/rtc_init.c | 2 +-
|
||||
components/esp_system/port/soc/esp32/clk.c | 2 +-
|
||||
components/esp_system/port/soc/esp32c2/clk.c | 2 +-
|
||||
components/esp_system/port/soc/esp32c3/clk.c | 2 +-
|
||||
components/esp_system/port/soc/esp32s2/clk.c | 2 +-
|
||||
components/esp_system/port/soc/esp32s3/clk.c | 2 +-
|
||||
15 files changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/components/esp_hw_support/port/esp32/include/soc/rtc.h b/components/esp_hw_support/port/esp32/include/soc/rtc.h
|
||||
index 22f7cfe157..1f0f9f2e77 100644
|
||||
--- a/components/esp_hw_support/port/esp32/include/soc/rtc.h
|
||||
+++ b/components/esp_hw_support/port/esp32/include/soc/rtc.h
|
||||
@@ -666,7 +666,7 @@ typedef struct rtc_config_s {
|
||||
* Initialize RTC clock and power control related functions
|
||||
* @param cfg configuration options as rtc_config_t
|
||||
*/
|
||||
-void rtc_init(rtc_config_t cfg);
|
||||
+void rtc_init_module(rtc_config_t cfg);
|
||||
|
||||
#define RTC_VDDSDIO_TIEH_1_8V 0 //!< TIEH field value for 1.8V VDDSDIO
|
||||
#define RTC_VDDSDIO_TIEH_3_3V 1 //!< TIEH field value for 3.3V VDDSDIO
|
||||
diff --git a/components/esp_hw_support/port/esp32/rtc_init.c b/components/esp_hw_support/port/esp32/rtc_init.c
|
||||
index 087824c279..9eecbef376 100644
|
||||
--- a/components/esp_hw_support/port/esp32/rtc_init.c
|
||||
+++ b/components/esp_hw_support/port/esp32/rtc_init.c
|
||||
@@ -17,7 +17,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
-void rtc_init(rtc_config_t cfg)
|
||||
+void rtc_init_module(rtc_config_t cfg)
|
||||
{
|
||||
/**
|
||||
* When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup
|
||||
diff --git a/components/esp_hw_support/port/esp32c2/include/soc/rtc.h b/components/esp_hw_support/port/esp32c2/include/soc/rtc.h
|
||||
index 9f8d412f59..3d2ae50f99 100644
|
||||
--- a/components/esp_hw_support/port/esp32c2/include/soc/rtc.h
|
||||
+++ b/components/esp_hw_support/port/esp32c2/include/soc/rtc.h
|
||||
@@ -690,7 +690,7 @@ typedef struct {
|
||||
* Initialize RTC clock and power control related functions
|
||||
* @param cfg configuration options as rtc_config_t
|
||||
*/
|
||||
-void rtc_init(rtc_config_t cfg);
|
||||
+void rtc_init_module(rtc_config_t cfg);
|
||||
|
||||
// -------------------------- CLOCK TREE DEFS ALIAS ----------------------------
|
||||
// **WARNING**: The following are only for backwards compatibility.
|
||||
diff --git a/components/esp_hw_support/port/esp32c2/rtc_init.c b/components/esp_hw_support/port/esp32c2/rtc_init.c
|
||||
index abb5370c67..32549d5376 100644
|
||||
--- a/components/esp_hw_support/port/esp32c2/rtc_init.c
|
||||
+++ b/components/esp_hw_support/port/esp32c2/rtc_init.c
|
||||
@@ -29,7 +29,7 @@ static void set_ocode_by_efuse(int ocode_scheme_ver);
|
||||
static void calibrate_ocode(void);
|
||||
static void set_rtc_dig_dbias(void);
|
||||
|
||||
-void rtc_init(rtc_config_t cfg)
|
||||
+void rtc_init_module(rtc_config_t cfg)
|
||||
{
|
||||
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_DIG_REG, 0);
|
||||
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_RTC_REG, 0);
|
||||
diff --git a/components/esp_hw_support/port/esp32c3/include/soc/rtc.h b/components/esp_hw_support/port/esp32c3/include/soc/rtc.h
|
||||
index 58a26dd41e..bae3de4931 100644
|
||||
--- a/components/esp_hw_support/port/esp32c3/include/soc/rtc.h
|
||||
+++ b/components/esp_hw_support/port/esp32c3/include/soc/rtc.h
|
||||
@@ -759,7 +759,7 @@ typedef struct {
|
||||
* Initialize RTC clock and power control related functions
|
||||
* @param cfg configuration options as rtc_config_t
|
||||
*/
|
||||
-void rtc_init(rtc_config_t cfg);
|
||||
+void rtc_init_module(rtc_config_t cfg);
|
||||
|
||||
// -------------------------- CLOCK TREE DEFS ALIAS ----------------------------
|
||||
// **WARNING**: The following are only for backwards compatibility.
|
||||
diff --git a/components/esp_hw_support/port/esp32c3/rtc_init.c b/components/esp_hw_support/port/esp32c3/rtc_init.c
|
||||
index c7a1eb55f0..ed62540c6e 100644
|
||||
--- a/components/esp_hw_support/port/esp32c3/rtc_init.c
|
||||
+++ b/components/esp_hw_support/port/esp32c3/rtc_init.c
|
||||
@@ -29,7 +29,7 @@ static void set_ocode_by_efuse(int calib_version);
|
||||
static void calibrate_ocode(void);
|
||||
static void set_rtc_dig_dbias(void);
|
||||
|
||||
-void rtc_init(rtc_config_t cfg)
|
||||
+void rtc_init_module(rtc_config_t cfg)
|
||||
{
|
||||
/**
|
||||
* When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup
|
||||
diff --git a/components/esp_hw_support/port/esp32s2/include/soc/rtc.h b/components/esp_hw_support/port/esp32s2/include/soc/rtc.h
|
||||
index 5a3dda4844..109e956af2 100644
|
||||
--- a/components/esp_hw_support/port/esp32s2/include/soc/rtc.h
|
||||
+++ b/components/esp_hw_support/port/esp32s2/include/soc/rtc.h
|
||||
@@ -799,7 +799,7 @@ typedef struct {
|
||||
* Initialize RTC clock and power control related functions
|
||||
* @param cfg configuration options as rtc_config_t
|
||||
*/
|
||||
-void rtc_init(rtc_config_t cfg);
|
||||
+void rtc_init_module(rtc_config_t cfg);
|
||||
|
||||
/**
|
||||
* Structure describing vddsdio configuration
|
||||
diff --git a/components/esp_hw_support/port/esp32s2/rtc_init.c b/components/esp_hw_support/port/esp32s2/rtc_init.c
|
||||
index 549cdffd43..0f1111c758 100644
|
||||
--- a/components/esp_hw_support/port/esp32s2/rtc_init.c
|
||||
+++ b/components/esp_hw_support/port/esp32s2/rtc_init.c
|
||||
@@ -26,7 +26,7 @@ __attribute__((unused)) static const char *TAG = "rtc_init";
|
||||
static void set_ocode_by_efuse(int calib_version);
|
||||
static void calibrate_ocode(void);
|
||||
|
||||
-void rtc_init(rtc_config_t cfg)
|
||||
+void rtc_init_module(rtc_config_t cfg)
|
||||
{
|
||||
/**
|
||||
* When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup
|
||||
diff --git a/components/esp_hw_support/port/esp32s3/include/soc/rtc.h b/components/esp_hw_support/port/esp32s3/include/soc/rtc.h
|
||||
index 27a4845f5f..f4c37716e5 100644
|
||||
--- a/components/esp_hw_support/port/esp32s3/include/soc/rtc.h
|
||||
+++ b/components/esp_hw_support/port/esp32s3/include/soc/rtc.h
|
||||
@@ -786,7 +786,7 @@ typedef struct {
|
||||
* Initialize RTC clock and power control related functions
|
||||
* @param cfg configuration options as rtc_config_t
|
||||
*/
|
||||
-void rtc_init(rtc_config_t cfg);
|
||||
+void rtc_init_module(rtc_config_t cfg);
|
||||
|
||||
/**
|
||||
* Structure describing vddsdio configuration
|
||||
diff --git a/components/esp_hw_support/port/esp32s3/rtc_init.c b/components/esp_hw_support/port/esp32s3/rtc_init.c
|
||||
index bbdf99ee89..3e28058c87 100644
|
||||
--- a/components/esp_hw_support/port/esp32s3/rtc_init.c
|
||||
+++ b/components/esp_hw_support/port/esp32s3/rtc_init.c
|
||||
@@ -43,7 +43,7 @@ uint32_t g_rtc_dbias_pvt_240m = 28;
|
||||
uint32_t g_dig_dbias_pvt_non_240m = 27;
|
||||
uint32_t g_rtc_dbias_pvt_non_240m = 27;
|
||||
|
||||
-void rtc_init(rtc_config_t cfg)
|
||||
+void rtc_init_module(rtc_config_t cfg)
|
||||
{
|
||||
/**
|
||||
* When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup
|
||||
diff --git a/components/esp_system/port/soc/esp32/clk.c b/components/esp_system/port/soc/esp32/clk.c
|
||||
index 88f72ff947..197a17b5e1 100644
|
||||
--- a/components/esp_system/port/soc/esp32/clk.c
|
||||
+++ b/components/esp_system/port/soc/esp32/clk.c
|
||||
@@ -109,7 +109,7 @@ static void select_rtc_slow_clk(slow_clk_sel_t slow_clk)
|
||||
void esp_rtc_init(void)
|
||||
{
|
||||
rtc_config_t cfg = RTC_CONFIG_DEFAULT();
|
||||
- rtc_init(cfg);
|
||||
+ rtc_init_module(cfg);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void esp_clk_init(void)
|
||||
diff --git a/components/esp_system/port/soc/esp32c2/clk.c b/components/esp_system/port/soc/esp32c2/clk.c
|
||||
index 6cc267ea6c..5c8fc6c2f4 100644
|
||||
--- a/components/esp_system/port/soc/esp32c2/clk.c
|
||||
+++ b/components/esp_system/port/soc/esp32c2/clk.c
|
||||
@@ -70,7 +70,7 @@ void esp_rtc_init(void)
|
||||
if (rst_reas == RESET_REASON_CHIP_POWER_ON) {
|
||||
cfg.cali_ocode = 1;
|
||||
}
|
||||
- rtc_init(cfg);
|
||||
+ rtc_init_module(cfg);
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --git a/components/esp_system/port/soc/esp32c3/clk.c b/components/esp_system/port/soc/esp32c3/clk.c
|
||||
index ecb5d08385..bc4687bbd6 100644
|
||||
--- a/components/esp_system/port/soc/esp32c3/clk.c
|
||||
+++ b/components/esp_system/port/soc/esp32c3/clk.c
|
||||
@@ -69,7 +69,7 @@ void esp_rtc_init(void)
|
||||
) {
|
||||
cfg.cali_ocode = 1;
|
||||
}
|
||||
- rtc_init(cfg);
|
||||
+ rtc_init_module(cfg);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void esp_clk_init(void)
|
||||
diff --git a/components/esp_system/port/soc/esp32s2/clk.c b/components/esp_system/port/soc/esp32s2/clk.c
|
||||
index 2b786b62f9..26d86af6c3 100644
|
||||
--- a/components/esp_system/port/soc/esp32s2/clk.c
|
||||
+++ b/components/esp_system/port/soc/esp32s2/clk.c
|
||||
@@ -72,7 +72,7 @@ void esp_rtc_init(void)
|
||||
esp_rom_output_tx_wait_idle(CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM);
|
||||
}
|
||||
}
|
||||
- rtc_init(cfg);
|
||||
+ rtc_init_module(cfg);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void esp_clk_init(void)
|
||||
diff --git a/components/esp_system/port/soc/esp32s3/clk.c b/components/esp_system/port/soc/esp32s3/clk.c
|
||||
index fac148fb41..fe6f9bee6d 100644
|
||||
--- a/components/esp_system/port/soc/esp32s3/clk.c
|
||||
+++ b/components/esp_system/port/soc/esp32s3/clk.c
|
||||
@@ -71,7 +71,7 @@ void esp_rtc_init(void)
|
||||
if (rst_reas == RESET_REASON_CHIP_POWER_ON) {
|
||||
cfg.cali_ocode = 1;
|
||||
}
|
||||
- rtc_init(cfg);
|
||||
+ rtc_init_module(cfg);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void esp_clk_init(void)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From d52016bf6f16eac0c3a4b895707368ee8a3babea Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Sun, 2 Mar 2025 17:15:03 +0100
|
||||
Subject: [PATCH 27/28] wpa_supplicant: fix include to find correct base64.h
|
||||
|
||||
---
|
||||
components/wpa_supplicant/src/tls/tlsv1_cred.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/wpa_supplicant/src/tls/tlsv1_cred.c b/components/wpa_supplicant/src/tls/tlsv1_cred.c
|
||||
index 0cee09749d..4d5d9d0b29 100644
|
||||
--- a/components/wpa_supplicant/src/tls/tlsv1_cred.c
|
||||
+++ b/components/wpa_supplicant/src/tls/tlsv1_cred.c
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "includes.h"
|
||||
|
||||
#include "common.h"
|
||||
-#include "base64.h"
|
||||
+#include "utils/base64.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "crypto/sha1.h"
|
||||
#include "pkcs5.h"
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,190 @@
|
||||
From 6a80d252810469dd3c6e0bbd4f27de02c90cb12e Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Tue, 11 Mar 2025 02:01:29 +0100
|
||||
Subject: [PATCH 28/28] heap: add prefix esp_ to tlsf to avoid conflicts with
|
||||
tlsf package
|
||||
|
||||
---
|
||||
components/heap/multi_heap.c | 58 ++++++++++++++++++------------------
|
||||
1 file changed, 29 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/components/heap/multi_heap.c b/components/heap/multi_heap.c
|
||||
index d47a6c0a3a..78fc411b74 100644
|
||||
--- a/components/heap/multi_heap.c
|
||||
+++ b/components/heap/multi_heap.c
|
||||
@@ -15,8 +15,8 @@
|
||||
#include "multi_heap.h"
|
||||
#include "multi_heap_internal.h"
|
||||
|
||||
-#include "tlsf.h"
|
||||
-#include "tlsf_block_functions.h"
|
||||
+#include "esp_tlsf.h"
|
||||
+#include "esp_tlsf_block_functions.h"
|
||||
|
||||
/* Note: Keep platform-specific parts in this header, this source
|
||||
file should depend on libc only */
|
||||
@@ -110,7 +110,7 @@ void multi_heap_in_rom_init(void)
|
||||
/* Check a block is valid for this heap. Used to verify parameters. */
|
||||
__attribute__((noinline)) NOCLONE_ATTR static void assert_valid_block(const heap_t *heap, const multi_heap_block_handle_t block)
|
||||
{
|
||||
- pool_t pool = tlsf_get_pool(heap->heap_data);
|
||||
+ pool_t pool = esp_tlsf_get_pool(heap->heap_data);
|
||||
void *ptr = block_to_ptr(block);
|
||||
|
||||
MULTI_HEAP_ASSERT((ptr >= pool) &&
|
||||
@@ -125,7 +125,7 @@ void *multi_heap_get_block_address_impl(multi_heap_block_handle_t block)
|
||||
|
||||
size_t multi_heap_get_allocated_size_impl(multi_heap_handle_t heap, void *p)
|
||||
{
|
||||
- return tlsf_block_size(p);
|
||||
+ return esp_tlsf_block_size(p);
|
||||
}
|
||||
|
||||
multi_heap_handle_t multi_heap_register_impl(void *start_ptr, size_t size)
|
||||
@@ -142,13 +142,13 @@ multi_heap_handle_t multi_heap_register_impl(void *start_ptr, size_t size)
|
||||
/* Do not specify any maximum size for the allocations so that the default configuration is used */
|
||||
const size_t max_bytes = 0;
|
||||
|
||||
- result->heap_data = tlsf_create_with_pool(start_ptr + sizeof(heap_t), size, max_bytes);
|
||||
+ result->heap_data = esp_tlsf_create_with_pool(start_ptr + sizeof(heap_t), size, max_bytes);
|
||||
if(!result->heap_data) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result->lock = NULL;
|
||||
- result->free_bytes = size - tlsf_size(result->heap_data);
|
||||
+ result->free_bytes = size - esp_tlsf_size(result->heap_data);
|
||||
result->pool_size = size;
|
||||
result->minimum_free_bytes = result->free_bytes;
|
||||
return result;
|
||||
@@ -172,7 +172,7 @@ void multi_heap_internal_unlock(multi_heap_handle_t heap)
|
||||
multi_heap_block_handle_t multi_heap_get_first_block(multi_heap_handle_t heap)
|
||||
{
|
||||
assert(heap != NULL);
|
||||
- pool_t pool = tlsf_get_pool(heap->heap_data);
|
||||
+ pool_t pool = esp_tlsf_get_pool(heap->heap_data);
|
||||
multi_heap_block_handle_t block = offset_to_block(pool, -(int)block_header_overhead);
|
||||
|
||||
return block;
|
||||
@@ -206,10 +206,10 @@ void *multi_heap_malloc_impl(multi_heap_handle_t heap, size_t size)
|
||||
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
- void *result = tlsf_malloc(heap->heap_data, size);
|
||||
+ void *result = esp_tlsf_malloc(heap->heap_data, size);
|
||||
if(result) {
|
||||
- heap->free_bytes -= tlsf_block_size(result);
|
||||
- heap->free_bytes -= tlsf_alloc_overhead();
|
||||
+ heap->free_bytes -= esp_tlsf_block_size(result);
|
||||
+ heap->free_bytes -= esp_tlsf_alloc_overhead();
|
||||
if (heap->free_bytes < heap->minimum_free_bytes) {
|
||||
heap->minimum_free_bytes = heap->free_bytes;
|
||||
}
|
||||
@@ -228,9 +228,9 @@ void multi_heap_free_impl(multi_heap_handle_t heap, void *p)
|
||||
assert_valid_block(heap, block_from_ptr(p));
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
- heap->free_bytes += tlsf_block_size(p);
|
||||
- heap->free_bytes += tlsf_alloc_overhead();
|
||||
- tlsf_free(heap->heap_data, p);
|
||||
+ heap->free_bytes += esp_tlsf_block_size(p);
|
||||
+ heap->free_bytes += esp_tlsf_alloc_overhead();
|
||||
+ esp_tlsf_free(heap->heap_data, p);
|
||||
multi_heap_internal_unlock(heap);
|
||||
}
|
||||
|
||||
@@ -249,13 +249,13 @@ void *multi_heap_realloc_impl(multi_heap_handle_t heap, void *p, size_t size)
|
||||
}
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
- size_t previous_block_size = tlsf_block_size(p);
|
||||
- void *result = tlsf_realloc(heap->heap_data, p, size);
|
||||
+ size_t previous_block_size = esp_tlsf_block_size(p);
|
||||
+ void *result = esp_tlsf_realloc(heap->heap_data, p, size);
|
||||
if(result) {
|
||||
- /* No need to subtract the tlsf_alloc_overhead() as it has already
|
||||
+ /* No need to subtract the esp_tlsf_alloc_overhead() as it has already
|
||||
* been subtracted when allocating the block at first with malloc */
|
||||
heap->free_bytes += previous_block_size;
|
||||
- heap->free_bytes -= tlsf_block_size(result);
|
||||
+ heap->free_bytes -= esp_tlsf_block_size(result);
|
||||
if (heap->free_bytes < heap->minimum_free_bytes) {
|
||||
heap->minimum_free_bytes = heap->free_bytes;
|
||||
}
|
||||
@@ -282,10 +282,10 @@ void *multi_heap_aligned_alloc_impl_offs(multi_heap_handle_t heap, size_t size,
|
||||
}
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
- void *result = tlsf_memalign_offs(heap->heap_data, alignment, size, offset);
|
||||
+ void *result = esp_tlsf_memalign_offs(heap->heap_data, alignment, size, offset);
|
||||
if(result) {
|
||||
- heap->free_bytes -= tlsf_block_size(result);
|
||||
- heap->free_bytes -= tlsf_alloc_overhead();
|
||||
+ heap->free_bytes -= esp_tlsf_block_size(result);
|
||||
+ heap->free_bytes -= esp_tlsf_alloc_overhead();
|
||||
if(heap->free_bytes < heap->minimum_free_bytes) {
|
||||
heap->minimum_free_bytes = heap->free_bytes;
|
||||
}
|
||||
@@ -322,7 +322,7 @@ static bool g_print_errors = false;
|
||||
*
|
||||
* @return bool: true if the the memory is not corrupted, false if the memory if corrupted.
|
||||
*/
|
||||
-bool tlsf_check_hook(void *start, size_t size, bool is_free)
|
||||
+bool esp_tlsf_check_hook(void *start, size_t size, bool is_free)
|
||||
{
|
||||
return multi_heap_internal_check_block_poisoning(start, size, is_free, g_print_errors);
|
||||
}
|
||||
@@ -341,11 +341,11 @@ bool multi_heap_check(multi_heap_handle_t heap, bool print_errors)
|
||||
(void) print_errors;
|
||||
#endif
|
||||
|
||||
- if(tlsf_check(heap->heap_data)) {
|
||||
+ if(esp_tlsf_check(heap->heap_data)) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
- if(tlsf_check_pool(tlsf_get_pool(heap->heap_data))) {
|
||||
+ if(esp_tlsf_check_pool(esp_tlsf_get_pool(heap->heap_data))) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ void multi_heap_dump(multi_heap_handle_t heap)
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
MULTI_HEAP_STDERR_PRINTF("Showing data for heap: %p \n", (void *)heap);
|
||||
- tlsf_walk_pool(tlsf_get_pool(heap->heap_data), multi_heap_dump_tlsf, NULL);
|
||||
+ esp_tlsf_walk_pool(esp_tlsf_get_pool(heap->heap_data), multi_heap_dump_tlsf, NULL);
|
||||
multi_heap_internal_unlock(heap);
|
||||
}
|
||||
|
||||
@@ -417,14 +417,14 @@ void multi_heap_get_info_impl(multi_heap_handle_t heap, multi_heap_info_t *info)
|
||||
}
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
- tlsf_walk_pool(tlsf_get_pool(heap->heap_data), multi_heap_get_info_tlsf, info);
|
||||
+ esp_tlsf_walk_pool(esp_tlsf_get_pool(heap->heap_data), multi_heap_get_info_tlsf, info);
|
||||
/* TLSF has an overhead per block. Calculate the total amount of overhead, it shall not be
|
||||
* part of the allocated bytes */
|
||||
- overhead = info->allocated_blocks * tlsf_alloc_overhead();
|
||||
- info->total_allocated_bytes = (heap->pool_size - tlsf_size(heap->heap_data)) - heap->free_bytes - overhead;
|
||||
+ overhead = info->allocated_blocks * esp_tlsf_alloc_overhead();
|
||||
+ info->total_allocated_bytes = (heap->pool_size - esp_tlsf_size(heap->heap_data)) - heap->free_bytes - overhead;
|
||||
info->minimum_free_bytes = heap->minimum_free_bytes;
|
||||
info->total_free_bytes = heap->free_bytes;
|
||||
- info->largest_free_block = tlsf_fit_size(heap->heap_data, info->largest_free_block);
|
||||
+ info->largest_free_block = esp_tlsf_fit_size(heap->heap_data, info->largest_free_block);
|
||||
multi_heap_internal_unlock(heap);
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ void multi_heap_walk(multi_heap_handle_t heap, multi_heap_walker_cb_t walker_fun
|
||||
assert(heap != NULL);
|
||||
|
||||
multi_heap_internal_lock(heap);
|
||||
- tlsf_walk_pool(tlsf_get_pool(heap->heap_data), walker_func, user_data);
|
||||
+ esp_tlsf_walk_pool(esp_tlsf_get_pool(heap->heap_data), walker_func, user_data);
|
||||
multi_heap_internal_unlock(heap);
|
||||
}
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
From 415abab5769271f7d68b6c0daae68c54fe411734 Mon Sep 17 00:00:00 2001
|
||||
From: Gunar Schorcht <gunar@schorcht.net>
|
||||
Date: Thu, 10 Apr 2025 00:29:40 +0200
|
||||
Subject: [PATCH 30/30] newlib: remove semaphore.h to avoid conflicts
|
||||
|
||||
---
|
||||
.../newlib/platform_include/semaphore.h | 73 -------------------
|
||||
1 file changed, 73 deletions(-)
|
||||
delete mode 100644 components/newlib/platform_include/semaphore.h
|
||||
|
||||
diff --git a/components/newlib/platform_include/semaphore.h b/components/newlib/platform_include/semaphore.h
|
||||
deleted file mode 100644
|
||||
index 31d47d2072..0000000000
|
||||
--- a/components/newlib/platform_include/semaphore.h
|
||||
+++ /dev/null
|
||||
@@ -1,73 +0,0 @@
|
||||
-/*
|
||||
- * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
- *
|
||||
- * SPDX-License-Identifier: Apache-2.0
|
||||
- */
|
||||
-
|
||||
-#pragma once
|
||||
-
|
||||
-#include <time.h>
|
||||
-
|
||||
-#ifdef __cplusplus
|
||||
-extern "C" {
|
||||
-#endif
|
||||
-
|
||||
-typedef unsigned int sem_t;
|
||||
-
|
||||
-/**
|
||||
- * This is the maximum value to which any POSIX semaphore can count on ESP chips.
|
||||
- */
|
||||
-#define SEM_VALUE_MAX 0x7FFF
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- *
|
||||
- * Must NOT be called if threads are still blocked on semaphore!
|
||||
- */
|
||||
-int sem_destroy(sem_t *sem);
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- *
|
||||
- * Note that on ESP chips, pshared is ignored. Semaphores can always be shared between FreeRTOS tasks.
|
||||
- */
|
||||
-int sem_init(sem_t *sem, int pshared, unsigned value);
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- *
|
||||
- * Note that, unlike specified in POSIX, this implementation returns -1 and sets errno to
|
||||
- * EAGAIN if the semaphore can not be unlocked (posted) due to its value being SEM_VALUE_MAX.
|
||||
- */
|
||||
-int sem_post(sem_t *sem);
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- *
|
||||
- * Note the following three deviations/issues originating from the underlying FreeRTOS implementation:
|
||||
- * * The time value passed by abstime will be rounded up to the next FreeRTOS tick.
|
||||
- * * The actual timeout will happen after the tick the time was rounded to
|
||||
- * and before the following tick.
|
||||
- * * It is possible, though unlikely, that the task is preempted directly after the timeout calculation,
|
||||
- * delaying timeout of the following blocking operating system call by the duration of the preemption.
|
||||
- */
|
||||
-int sem_timedwait(sem_t *semaphore, const struct timespec *abstime);
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- */
|
||||
-int sem_trywait(sem_t *sem);
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- */
|
||||
-int sem_wait(sem_t *sem);
|
||||
-
|
||||
-/**
|
||||
- * This is a POSIX function, please refer to the POSIX specification for a detailed description.
|
||||
- */
|
||||
-int sem_getvalue(sem_t *sem, int *sval);
|
||||
-
|
||||
-#ifdef __cplusplus
|
||||
-}
|
||||
-#endif
|
||||
--
|
||||
2.34.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user