[ Prev ] [ Index ] [ Next ]

Running code from RAM

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.


  1. Go to Project → Properties → C/C++ Build → Settings → Tool Settings tab → MCU GCC Linker
  2. Set Linker Script to ${workspace_loc:/${ProjName}/STM32H750VBTX_RAM.ld}
  3. Go to Project → Properties → C/C++ General → Paths and Symbols → Symbols tab
  4. Add symbol VECT_TAB_SRAM
  5. (2022 update) Uncomment #define USER_VECT_TAB_ADDRESS in system_stm32h7xx.c
  6. (2022 update) Set correct address #define VECT_TAB_BASE_ADDRESS SOME_ADDRESS (e.g. CD_ITCMRAM_BASE) in system_stm32h7xx.c
  7. Run your program from RAM Debug or jump to RAM address from flash