Skip to content

Commit a08cac0

Browse files
committed
Update Generic F4 linker script to support STM32 HID bootloader
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 0ae4a3d commit a08cac0

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

variants/BLACK_F407XX/ldscript.ld

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
ENTRY(Reset_Handler)
5353

5454
/* Highest address of the user mode stack */
55-
_estack = 0x20020000; /* end of RAM */
55+
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */
5656
/* Generate a link error if heap and stack don't fit into RAM */
5757
_Min_Heap_Size = 0x200; /* required amount of heap */
5858
_Min_Stack_Size = 0x400; /* required amount of stack */
5959

6060
/* Specify the memory areas */
6161
MEMORY
6262
{
63-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
63+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
6464
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
65-
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = LD_MAX_SIZE
65+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
6666
}
6767

6868
/* Define output sections */

variants/BLUE_F407VE_Mini/ldscript.ld

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
ENTRY(Reset_Handler)
5353

5454
/* Highest address of the user mode stack */
55-
_estack = 0x20020000; /* end of RAM */
55+
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */
5656
/* Generate a link error if heap and stack don't fit into RAM */
5757
_Min_Heap_Size = 0x200; /* required amount of heap */
5858
_Min_Stack_Size = 0x400; /* required amount of stack */
5959

6060
/* Specify the memory areas */
6161
MEMORY
6262
{
63-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
63+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
6464
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
65-
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
65+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
6666
}
6767

6868
/* Define output sections */

variants/FK407M1/ldscript.ld

+3-5
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
ENTRY(Reset_Handler)
5353

5454
/* Highest address of the user mode stack */
55-
_estack = 0x20020000; /* end of RAM */
55+
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */
5656
/* Generate a link error if heap and stack don't fit into RAM */
5757
_Min_Heap_Size = 0x200; /* required amount of heap */
5858
_Min_Stack_Size = 0x400; /* required amount of stack */
5959

6060
/* Specify the memory areas */
6161
MEMORY
6262
{
63-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
63+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
6464
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
65-
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
65+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
6666
}
6767

6868
/* Define output sections */
@@ -204,5 +204,3 @@ SECTIONS
204204

205205
.ARM.attributes 0 : { *(.ARM.attributes) }
206206
}
207-
208-

0 commit comments

Comments
 (0)