Skip to content

Commit 469961e

Browse files
Update CM4 linker script assertion
1 parent 1179dd7 commit 469961e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

targets/TARGET_STM/TARGET_STM32H7/linker_scripts/STM32H745_47_FAMILY/CM4/STM32H745_H747_CM4.ld

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ SECTIONS
182182
_ebss = .;
183183
} > SRAM_D2
184184

185+
/* Check if data + stack will exceed SRAM limit */
186+
ASSERT(_ebss < ORIGIN(SRAM_D2) + LENGTH(SRAM_D2) - MBED_CONF_TARGET_BOOT_STACK_SIZE, "region SRAM does not have enough space for boot stack size")
187+
185188
.heap (COPY):
186189
{
187190
__end__ = .;
188191
PROVIDE(end = .);
189-
PROVIDE(__mbed_sbrk_start = .);
190192
*(.heap*)
191193
. = ORIGIN(SRAM_D2) + LENGTH(SRAM_D2) - MBED_CONF_TARGET_BOOT_STACK_SIZE;
192-
PROVIDE(__mbed_krbs_start = .);
193194
__HeapLimit = .;
194195
} > SRAM_D2
195196
/* .stack_dummy section doesn't contains any symbols. It is only
@@ -207,9 +208,6 @@ SECTIONS
207208
__StackLimit = __StackTop - MBED_CONF_TARGET_BOOT_STACK_SIZE;
208209
PROVIDE(__stack = __StackTop);
209210

210-
/* Check if data + heap + stack exceeds SRAM_D2 limit */
211-
ASSERT(__StackLimit >= __HeapLimit, "region SRAM_D2 overflowed with stack")
212-
213211
/* Put crash data in the otherwise unused D3 SRAM */
214212
.crash_data_ram :
215213
{

0 commit comments

Comments
 (0)