Skip to content

Commit 2d83497

Browse files
committed
stm32h747: cm4: set VTOR at boot
1 parent 7d043cf commit 2d83497

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/system_stm32h7xx_dualcore_boot_cm4_cm7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ __weak void SystemInit (void)
232232
/* Configure the Vector Table location add offset address ------------------*/
233233
#ifdef VECT_TAB_SRAM
234234
SCB->VTOR = D2_AXISRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
235-
#elif !defined(NO_VTOR_RELOCATE)
235+
#else
236236
#include "nvic_addr.h" // MBED
237237
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; // MBED
238238
#endif

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@
3838
MEMORY
3939
{
4040
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
41-
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE
41+
RAM_D2 (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE
4242
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
4343
}
4444

45+
#if (CM4_BINARY_START == 0x60000000)
46+
REGION_ALIAS("RAM", FLASH);
47+
#else
48+
REGION_ALIAS("RAM", RAM_D2);
49+
#endif
50+
4551
/* Linker script to place sections and symbol values. Should be used together
4652
* with other linker script that defines memory regions FLASH and RAM.
4753
* It references following symbols, which must be defined in code:

0 commit comments

Comments
 (0)