2828ENTRY (Reset_Handler )
2929
3030/* Highest address of the user mode stack */
31- _estack = ORIGIN (RAM ) + LENGTH (RAM ); /* end of "RAM" Ram type memory */
31+ _estack = ORIGIN (RAM1 ) + LENGTH (RAM1 ) + LENGTH ( RAM2 ); /* end of "RAM" Ram type memory */
3232
33- _Min_Heap_Size = 0x200 ; /* required amount of heap */
34- _Min_Stack_Size = 0x400 ; /* required amount of stack */
33+ _Min_Heap_Size = 0x200 ; /* required amount of heap */
34+ _Min_Stack_Size = 0x400 ; /* required amount of stack */
3535
3636/* Memories definition */
3737MEMORY
3838{
39- BL_FLAG_RAM (xrw) : ORIGIN = 0x20000000 , LENGTH = 64 /* Bootloader flag in RAM */
40- RAM (xrw) : ORIGIN = 0x20000040 , LENGTH = 512K - 64
41- SIGNATURE ( rx) : ORIGIN = 0x07FFFFC0 , LENGTH = 64 /* Never written to the FLASH, it is for binary signature. */
39+ RAM1 (xrw) : ORIGIN = 0x20000000 , LENGTH = 128K
40+ RAM2 (xrw) : ORIGIN = 0x20020000 , LENGTH = 512K - 128K - 64K
41+ BL_FLAG_RAM ( xrw) : ORIGIN = 0x20070000 , LENGTH = 64 /* Bootloader flag in RAM */
4242 FLASH (rx) : ORIGIN = 0x08000000 , LENGTH = 128K
4343}
4444
4545/* Sections */
4646SECTIONS
4747{
48- /* The startup code into "RAM" Rom type memory */
48+ /* The startup code into "RAM" Ram type memory */
4949 .isr_vector :
5050 {
5151 . = ALIGN (4 );
5252 KEEP (*(.isr_vector )) /* Startup code */
5353 . = ALIGN (4 );
54- } >RAM
54+ } >RAM2
5555
56- /* The program code and other data into "RAM" Rom type memory */
56+ /* The program code and other data into "RAM" Ram type memory */
5757 .text :
5858 {
5959 . = ALIGN (4 );
@@ -62,36 +62,38 @@ SECTIONS
6262 *(.glue_7 ) /* glue arm to thumb code */
6363 *(.glue_7t ) /* glue thumb to arm code */
6464 *(.eh_frame )
65+ *(.RamFunc ) /* .RamFunc sections */
66+ *(.RamFunc *) /* .RamFunc* sections */
6567
6668 KEEP (*(.init ))
6769 KEEP (*(.fini ))
6870
6971 . = ALIGN (4 );
7072 _etext = .; /* define a global symbols at end of code */
71- } >RAM
73+ } >RAM2
7274
73- /* Constant data into "RAM" Rom type memory */
75+ /* Constant data into "RAM" Ram type memory */
7476 .rodata :
7577 {
7678 . = ALIGN (4 );
7779 *(.rodata ) /* .rodata sections (constants, strings, etc.) */
7880 *(.rodata *) /* .rodata* sections (constants, strings, etc.) */
7981 . = ALIGN (4 );
80- } >RAM
82+ } >RAM2
8183
8284 .ARM.extab : {
8385 . = ALIGN (4 );
8486 *(.ARM .extab * .gnu .linkonce .armextab .*)
8587 . = ALIGN (4 );
86- } >RAM
88+ } >RAM2
8789
8890 .ARM : {
8991 . = ALIGN (4 );
9092 __exidx_start = .;
9193 *(.ARM .exidx *)
9294 __exidx_end = .;
9395 . = ALIGN (4 );
94- } >RAM
96+ } >RAM2
9597
9698 .preinit_array :
9799 {
@@ -100,7 +102,7 @@ SECTIONS
100102 KEEP (*(.preinit_array *))
101103 PROVIDE_HIDDEN (__preinit_array_end = .);
102104 . = ALIGN (4 );
103- } >RAM
105+ } >RAM2
104106
105107 .init_array :
106108 {
@@ -110,7 +112,7 @@ SECTIONS
110112 KEEP (*(.init_array *))
111113 PROVIDE_HIDDEN (__init_array_end = .);
112114 . = ALIGN (4 );
113- } >RAM
115+ } >RAM2
114116
115117 .fini_array :
116118 {
@@ -120,30 +122,28 @@ SECTIONS
120122 KEEP (*(.fini_array *))
121123 PROVIDE_HIDDEN (__fini_array_end = .);
122124 . = ALIGN (4 );
123- } >RAM
124-
125- .restart_info : ALIGN (4 )
126- {
127- KEEP (*(.restart_info ))
128- } >RAM AT > RAM
125+ } >RAM2
129126
130127 /* Used by the startup to initialize data */
131128 _sidata = LOADADDR (.data );
132129
130+ .restart_info : ALIGN (4 )
131+ {
132+ KEEP (*(.restart_info ))
133+ } >RAM1 AT > RAM2
134+
133135 /* Initialized data sections into "RAM" Ram type memory */
134136 .data :
135137 {
136138 . = ALIGN (4 );
137139 _sdata = .; /* create a global symbol at data start */
138140 *(.data ) /* .data sections */
139141 *(.data *) /* .data* sections */
140- *(.RamFunc ) /* .RamFunc sections */
141- *(.RamFunc *) /* .RamFunc* sections */
142142
143143 . = ALIGN (4 );
144144 _edata = .; /* define a global symbol at data end */
145145
146- } >RAM AT > RAM
146+ } >RAM1 AT > RAM2
147147
148148 /* Uninitialized data section into "RAM" Ram type memory */
149149 . = ALIGN (4 );
@@ -159,7 +159,7 @@ SECTIONS
159159 . = ALIGN (4 );
160160 _ebss = .; /* define a global symbol at bss end */
161161 __bss_end__ = _ebss;
162- } >RAM
162+ } >RAM1 AT > RAM2
163163
164164 /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
165165 ._user_heap_stack :
@@ -170,7 +170,7 @@ SECTIONS
170170 . = . + _Min_Heap_Size;
171171 . = . + _Min_Stack_Size;
172172 . = ALIGN (8 );
173- } >RAM
173+ } >RAM1 AT > RAM2
174174
175175 /* Remove information from the compiler libraries */
176176 /DISCARD/ :
0 commit comments