Skip to content

Commit 870c3bc

Browse files
author
Cruz Monrreal
authored
Merge pull request #8554 from bcostm/l4R5zi_data_alignment
NUCLEO_L4R5ZI: Fix alignment of execute region to 8byte boundary
2 parents 63946d5 + 66ab546 commit 870c3bc

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4R5xI/device/TOOLCHAIN_ARM_MICRO/stm32l4r5xx.sct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
4545
.ANY (+RO)
4646
}
4747

48-
; Total: 111 vectors = 444 bytes (0x1BC) to be reserved in RAM
49-
RW_IRAM1 (0x20000000+0x1BC) (0xA0000-0x1BC) { ; RW data
48+
; Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM
49+
RW_IRAM1 (0x20000000+0x1C0) (0xA0000-0x1C0) { ; RW data
5050
.ANY (+RW +ZI)
5151
}
5252
}

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4R5xI/device/TOOLCHAIN_ARM_STD/stm32l4r5xx.sct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
4545
.ANY (+RO)
4646
}
4747

48-
; Total: 111 vectors = 444 bytes (0x1BC) to be reserved in RAM
49-
RW_IRAM1 (0x20000000+0x1BC) (0xA0000-0x1BC) { ; RW data
48+
; Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM
49+
RW_IRAM1 (0x20000000+0x1C0) (0xA0000-0x1C0) { ; RW data
5050
.ANY (+RW +ZI)
5151
}
5252
}

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4R5xI/device/TOOLCHAIN_GCC_ARM/stm32l4r5xx.ld

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
#endif
88

99
/* Linker script to configure memory regions. */
10+
/* Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM */
1011
MEMORY
1112
{
1213
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
13-
SRAM1 (rwx) : ORIGIN = 0x200001BC, LENGTH = 640k - 0x1BC
14+
SRAM1 (rwx) : ORIGIN = 0x200001C0, LENGTH = 640k - 0x1C0
1415
}
1516

1617
/* Linker script to place sections and symbol values. Should be used together
@@ -92,28 +93,29 @@ SECTIONS
9293
*(vtable)
9394
*(.data*)
9495

95-
. = ALIGN(4);
96+
. = ALIGN(8);
9697
/* preinit data */
9798
PROVIDE_HIDDEN (__preinit_array_start = .);
9899
KEEP(*(.preinit_array))
99100
PROVIDE_HIDDEN (__preinit_array_end = .);
100101

101-
. = ALIGN(4);
102+
. = ALIGN(8);
102103
/* init data */
103104
PROVIDE_HIDDEN (__init_array_start = .);
104105
KEEP(*(SORT(.init_array.*)))
105106
KEEP(*(.init_array))
106107
PROVIDE_HIDDEN (__init_array_end = .);
107108

108-
. = ALIGN(4);
109+
110+
. = ALIGN(8);
109111
/* finit data */
110112
PROVIDE_HIDDEN (__fini_array_start = .);
111113
KEEP(*(SORT(.fini_array.*)))
112114
KEEP(*(.fini_array))
113115
PROVIDE_HIDDEN (__fini_array_end = .);
114116

115117
KEEP(*(.jcr*))
116-
. = ALIGN(4);
118+
. = ALIGN(8);
117119
/* All data end */
118120
__data_end__ = .;
119121
_edata = .;
@@ -122,12 +124,12 @@ SECTIONS
122124

123125
.bss :
124126
{
125-
. = ALIGN(4);
127+
. = ALIGN(8);
126128
__bss_start__ = .;
127129
_sbss = .;
128130
*(.bss*)
129131
*(COMMON)
130-
. = ALIGN(4);
132+
. = ALIGN(8);
131133
__bss_end__ = .;
132134
_ebss = .;
133135
} > SRAM1

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4R5xI/device/TOOLCHAIN_IAR/stm32l4r5xx.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ define symbol __region_ROM_start__ = MBED_APP_START;
77
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
88

99
/* [RAM = 640KB = 0xA0000] */
10-
/* Vector table dynamic copy: Total: 111 vectors = 444 bytes (0x1BC) to be reserved in RAM */
11-
/* Reserved 448 bytes (0x1C0) to be aligned on 8 bytes (448 = 56 x 8) */
10+
/* Vector table dynamic copy */
11+
/* Total: 111 vectors = 444 bytes (0x1BC) (+ 4 bytes for 8-byte alignment) to be reserved in RAM */
1212
define symbol __NVIC_start__ = 0x20000000;
1313
define symbol __NVIC_end__ = 0x20000000 + 0x1C0 - 1;
1414
define symbol __region_SRAM1_start__ = 0x20000000 + 0x1C0;

0 commit comments

Comments
 (0)