Created Saturday 11 November 2023
Example for STM32H7
By default, STM32CubeIDE will generate project with STM32H750VBTX_FLASH.ld linker script. To run code from RAM, you need to change settings to use STM32H750VBTX_RAM.ld script and add symbol VECT_TAB_SRAM.
- Go to Project → Properties → C/C++ Build → Settings → Tool Settings tab → MCU GCC Linker
- Set Linker Script to ${workspace_loc:/${ProjName}/STM32H750VBTX_RAM.ld}
- Go to Project → Properties → C/C++ General → Paths and Symbols → Symbols tab
- Add symbol VECT_TAB_SRAM
- (2022 update) Uncomment #define USER_VECT_TAB_ADDRESS in system_stm32h7xx.c
- (2022 update) Set correct address #define VECT_TAB_BASE_ADDRESS SOME_ADDRESS (e.g. CD_ITCMRAM_BASE) in system_stm32h7xx.c
- Run your program from RAM Debug or jump to RAM address from flash