Merge branch 'bugfix/ulp_max_mem' into 'master'

fix(ulp): correct target LP memory reservation limits

Closes IDF-11974

See merge request espressif/esp-idf!48065
This commit is contained in:
Marius Vikhammer
2026-05-08 14:08:21 +08:00
2 changed files with 22 additions and 2 deletions
+12 -2
View File
@@ -2,6 +2,16 @@
#include "ld.common"
#if CONFIG_SOC_RTC_MEM_SUPPORTED
#if CONFIG_ULP_COPROC_ENABLED
#define RTC_SLOW_SEGMENT_FIT_ERROR \
"RTC_SLOW segment data does not fit. CONFIG_ULP_COPROC_RESERVE_MEM may be too large for the remaining LP/RTC RAM; lower it or shrink application .rtc.* usage."
#define RTC_FAST_SEGMENT_FIT_ERROR \
"RTC_FAST segment data does not fit. CONFIG_ULP_COPROC_RESERVE_MEM may be too large for the remaining LP/RTC RAM; lower it or shrink application .rtc.* usage."
#else
#define RTC_SLOW_SEGMENT_FIT_ERROR "RTC_SLOW segment data does not fit."
#define RTC_FAST_SEGMENT_FIT_ERROR "RTC_FAST segment data does not fit."
#endif
/**
* RTC fast memory holds RTC wake stub code,
* including from any source file named rtc_wake_stub*.c
@@ -155,9 +165,9 @@
? (_rtc_force_fast_end - _rtc_fast_start)
: (_rtc_noinit_end - _rtc_fast_start);
ASSERT((_rtc_slow_length <= LENGTH(rtc_slow_seg)),
"RTC_SLOW segment data does not fit.")
RTC_SLOW_SEGMENT_FIT_ERROR)
ASSERT((_rtc_fast_length <= LENGTH(rtc_data_seg)),
"RTC_FAST segment data does not fit.")
RTC_FAST_SEGMENT_FIT_ERROR)
#if CONFIG_P4_REV3_MSPI_CRASH_AFTER_POWER_UP_WORKAROUND
.rtc.p4_rev3_mspi_workaround :
+10
View File
@@ -35,11 +35,21 @@ menu "Ultra Low Power (ULP) Co-processor"
default 4096 if !IDF_TARGET_ESP32
range 32 8176 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
range 32 16352 if IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6
range 32 32744 if IDF_TARGET_ESP32S31
range 32 31088 if IDF_TARGET_ESP32P4 # Some memory are reserved for ROM/RTC reserved
help
Bytes of memory to reserve for ULP Co-processor firmware & data.
Data is reserved at the beginning of RTC slow memory.
The target-specific maximum only accounts for fixed LP/RTC reservations
such as retained RTC data, LP ROM, and secure-boot digest storage.
On targets where the application RTC sections also live in LP/RTC RAM,
this reservation shares the same memory pool with .rtc.text,
RTC_DATA_ATTR, RTC_NOINIT_ATTR, RTC_SLOW_ATTR, and related sections.
Setting this value close to the maximum may therefore still leave too
little LP/RTC RAM for the rest of the application and cause link-time
errors.
menu "ULP RISC-V Settings"
depends on ULP_COPROC_TYPE_RISCV