Skip to content

Commit 4e63a71

Browse files
committed
esp32s3: fix memory section overlap
1 parent 346093f commit 4e63a71

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

targets/esp32s3.ld

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ ENTRY(call_start_cpu0)
1919

2020
SECTIONS
2121
{
22+
/* Put the stack at the bottom of DRAM, so that the application will
23+
* crash on stack overflow instead of silently corrupting memory.
24+
* See: http://blog.japaric.io/stack-overflow-protection/ */
25+
.stack (NOLOAD) :
26+
{
27+
. = ALIGN(16);
28+
. += _stack_size;
29+
_stack_top = .;
30+
} >DRAM
31+
2232
/* Constant literals and code. Loaded into IRAM for now. Eventually, most
2333
* code should be executed directly from flash.
2434
* Note that literals must be before code for the l32r instruction to work.
@@ -27,7 +37,7 @@ SECTIONS
2737
{
2838
*(.literal.call_start_cpu0)
2939
*(.text.call_start_cpu0)
30-
} >IRAM
40+
} >IRAM AT >DRAM
3141

3242
/* All other code and literals */
3343
.text : ALIGN(4)
@@ -36,17 +46,7 @@ SECTIONS
3646
*(.literal.* .text.*)
3747
*(.text)
3848
*(.text.*)
39-
} >IRAM
40-
41-
/* Put the stack at the bottom of DRAM, so that the application will
42-
* crash on stack overflow instead of silently corrupting memory.
43-
* See: http://blog.japaric.io/stack-overflow-protection/ */
44-
.stack (NOLOAD) :
45-
{
46-
. = ALIGN(16);
47-
. += _stack_size;
48-
_stack_top = .;
49-
} >DRAM
49+
} >IRAM AT >DRAM
5050

5151
/* Constant global variables.
5252
* They are loaded in DRAM for ease of use. Eventually they should be stored

0 commit comments

Comments
 (0)