Skip to content

Commit

Permalink
boards/esp32s3: Link stack checking function and data to SRAM when en…
Browse files Browse the repository at this point in the history
…able flash or PSRAM driver

During PSRAM initialization and flash operations, the Cache needs to be disabled.
So all data and code for the aforementioned scope is required to be placed in Internal RAM.
  • Loading branch information
donghengqaz authored and jerpelea committed Nov 9, 2023
1 parent bc43c41 commit c655870
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions boards/xtensa/esp32s3/common/scripts/legacy_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ SECTIONS
#ifdef CONFIG_ESP32S3_SPIRAM_MODE_OCT
*libarch.a:esp32s3_psram_octal.*(.literal .text .literal.* .text.*)
#endif
#if defined(CONFIG_STACK_CANARIES) && \
(defined(CONFIG_ESP32S3_SPIFLASH) || \
defined(CONFIG_ESP32S3_SPIRAM))
*libc.a:lib_stackchk.*(.literal .text .literal.* .text.*)
#endif

*(.wifirxiram .wifirxiram.*)
*(.wifi0iram .wifi0iram.*)
*(.wifiorslpiram .wifiorslpiram.*)
Expand Down Expand Up @@ -214,6 +220,11 @@ SECTIONS

*libphy.a:(.rodata .rodata.*)
*libarch.a:xtensa_context.*(.rodata .rodata.*)
#if defined(CONFIG_STACK_CANARIES) && \
(defined(CONFIG_ESP32S3_SPIFLASH) || \
defined(CONFIG_ESP32S3_SPIRAM))
*libc.a:lib_stackchk.*(.rodata .rodata.*)
#endif

_edata = ABSOLUTE(.);
. = ALIGN(4);
Expand Down

0 comments on commit c655870

Please sign in to comment.