soc: xtensa: espressif_esp32: add SPIRAM heap offset and size
The existing heap starts at the beginning of SPIRAM which is also occupied by the WiFi stack if CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM is enabled. This results in memory corruption. Update the linker description to add a _spiram_heap_start symbol and add a KConfig size option to allow the SPIRAM stack to be correctly located and sized. Requires matching commit in hal_espressif. Fixes: 61359 Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
This commit is contained in:
parent
d9fe63b188
commit
526ff047cc
6 changed files with 37 additions and 7 deletions
|
@ -333,6 +333,7 @@ SECTIONS
|
|||
#if defined(CONFIG_ESP_SPIRAM)
|
||||
.ext_ram.bss (NOLOAD):
|
||||
{
|
||||
_ext_ram_data_start = ABSOLUTE(.);
|
||||
_ext_ram_bss_start = ABSOLUTE(.);
|
||||
|
||||
#if defined(CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM)
|
||||
|
@ -342,10 +343,14 @@ SECTIONS
|
|||
*libsubsys__net__ip.a:(.noinit .noinit.*)
|
||||
*libsubsys__net.a:(.noinit .noinit.*)
|
||||
#endif
|
||||
_spiram_heap_start = ABSOLUTE(.);
|
||||
. = . + CONFIG_ESP_SPIRAM_HEAP_SIZE;
|
||||
|
||||
*(.ext_ram.bss*)
|
||||
. = ALIGN(4);
|
||||
_ext_ram_bss_end = ABSOLUTE(.) + CONFIG_ESP_SPIRAM_SIZE;
|
||||
_ext_ram_bss_end = ABSOLUTE(.);
|
||||
|
||||
_ext_ram_data_end = ABSOLUTE(.);
|
||||
} > ext_ram_seg
|
||||
#endif
|
||||
|
||||
|
@ -555,3 +560,8 @@ ASSERT(((__bss_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
|
|||
|
||||
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
|
||||
"IRAM0 segment data does not fit.")
|
||||
|
||||
#if defined(CONFIG_ESP_SPIRAM)
|
||||
ASSERT(((_ext_ram_data_end - _ext_ram_data_start) <= CONFIG_ESP_SPIRAM_SIZE),
|
||||
"External SPIRAM overflowed.")
|
||||
#endif /* CONFIG_ESP_SPIRAM */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue