|
| 1 | +From 2d834973fc86b787535204b174303a0311e1f36f Mon Sep 17 00:00:00 2001 |
| 2 | +From: Martino Facchin < [email protected]> |
| 3 | +Date: Fri, 19 Jan 2024 11:13:09 +0100 |
| 4 | +Subject: [PATCH] stm32h747: cm4: set VTOR at boot |
| 5 | + |
| 6 | +--- |
| 7 | + .../STM32Cube_FW/system_stm32h7xx_dualcore_boot_cm4_cm7.c | 2 +- |
| 8 | + .../TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld | 8 +++++++- |
| 9 | + 2 files changed, 8 insertions(+), 2 deletions(-) |
| 10 | + |
| 11 | +diff --git a/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/system_stm32h7xx_dualcore_boot_cm4_cm7.c b/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/system_stm32h7xx_dualcore_boot_cm4_cm7.c |
| 12 | +index b4a4cc7826..8e0017de2a 100644 |
| 13 | +--- a/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/system_stm32h7xx_dualcore_boot_cm4_cm7.c |
| 14 | ++++ b/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/system_stm32h7xx_dualcore_boot_cm4_cm7.c |
| 15 | +@@ -232,7 +232,7 @@ __weak void SystemInit (void) |
| 16 | + /* Configure the Vector Table location add offset address ------------------*/ |
| 17 | + #ifdef VECT_TAB_SRAM |
| 18 | + SCB->VTOR = D2_AXISRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
| 19 | +-#elif !defined(NO_VTOR_RELOCATE) |
| 20 | ++#else |
| 21 | + #include "nvic_addr.h" // MBED |
| 22 | + SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; // MBED |
| 23 | + #endif |
| 24 | +diff --git a/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld b/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld |
| 25 | +index ea81a18b11..7d2651dcb4 100644 |
| 26 | +--- a/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld |
| 27 | ++++ b/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld |
| 28 | +@@ -38,10 +38,16 @@ |
| 29 | + MEMORY |
| 30 | + { |
| 31 | + FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE |
| 32 | +- RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE |
| 33 | ++ RAM_D2 (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE |
| 34 | + RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K |
| 35 | + } |
| 36 | + |
| 37 | ++#if (CM4_BINARY_START == 0x60000000) |
| 38 | ++REGION_ALIAS("RAM", FLASH); |
| 39 | ++#else |
| 40 | ++REGION_ALIAS("RAM", RAM_D2); |
| 41 | ++#endif |
| 42 | ++ |
| 43 | + /* Linker script to place sections and symbol values. Should be used together |
| 44 | + * with other linker script that defines memory regions FLASH and RAM. |
| 45 | + * It references following symbols, which must be defined in code: |
| 46 | +-- |
| 47 | +2.43.0 |
| 48 | + |
0 commit comments