Skip to content

Commit fd9b2fa

Browse files
committed
Merge branch 'fix/tcm-mem-not-considered-in-esp_ptr_eexecutable' into 'master'
fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible Closes IDFGH-15339 and IDFGH-15337 See merge request espressif/esp-idf!39388
2 parents 2aeec90 + d8c054c commit fd9b2fa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

components/esp_hw_support/esp_memory_utils.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ bool esp_ptr_byte_accessible(const void *p)
5252
intptr_t ip = (intptr_t) p;
5353
bool r;
5454
r = (ip >= SOC_BYTE_ACCESSIBLE_LOW && ip < SOC_BYTE_ACCESSIBLE_HIGH);
55+
#if SOC_MEM_TCM_SUPPORTED
56+
r |= esp_ptr_in_tcm(p);
57+
#endif
5558
#if CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
5659
/* For ESP32 case, RTC fast memory is accessible to PRO cpu only and hence
5760
* for single core configuration (where it gets added to system heap) following

components/esp_hw_support/include/esp_memory_utils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ inline static bool esp_ptr_internal(const void *p) {
278278
bool r;
279279
r = ((intptr_t)p >= SOC_MEM_INTERNAL_LOW && (intptr_t)p < SOC_MEM_INTERNAL_HIGH);
280280

281+
#if SOC_MEM_TCM_SUPPORTED
282+
r |= esp_ptr_in_tcm(p);
283+
#endif
284+
281285
#if SOC_RTC_SLOW_MEM_SUPPORTED
282286
r |= ((intptr_t)p >= SOC_RTC_DATA_LOW && (intptr_t)p < SOC_RTC_DATA_HIGH);
283287
#endif

0 commit comments

Comments
 (0)