Skip to main content
Visitor
August 14, 2026
Question

Failed to run application loaded into SRAM on STM32F407

  • August 14, 2026
  • 1 reply
  • 20 views

Hello everyone,
I am trying to download and run my application firmware into internal SRAM of STM32F407, but it does not execute as expected.
Here is what I have done:
1. I built my project with Keil MDK‑ARM, configured the scatter‑linker script to place all code and data into SRAM region (0x20000000).
2. I generated the .bin firmware file.
3. Using STM32CubeProgrammer, I downloaded this bin file to SRAM address 0x20000000. Memory window verification shows the binary content is correctly written into SRAM.
4. I used the "Run after programming" option in STM32CubeProgrammer, or performed a software reset after downloading.
Symptom:
The tool reports download completes. However, my application is not actually running.
When I check the Cortex‑M4 core registers in STM32CubeProgrammer:
VTOR register shows value 0x1FFF0000, which points to ST‑system boot ROM, not my SRAM address 0x20000000. The CPU stays in the system bootloader, it never jumps to my SRAM‑located application.
I understand from the reference manual that STM32F4 supports SRAM‑boot mode controlled by BOOT0 and BOOT1 hardware pins.
But when I download firmware to SRAM via debugger and trigger software reset, the chip still boots from system memory instead of SRAM, even though the binary image is already present inside SRAM.
Questions:
1. Why does software reset not start executing code from SRAM, even if firmware is already loaded into SRAM?
2. What is the correct workflow in STM32CubeProgrammer to make the CPU run the SRAM‑loaded application?
3. Is manual modification of SP, PC and SCB->VTOR register required when debugging SRAM‑resident firmware?
Thank you.

1 reply

Aziz BRIGUI
ST Technical Moderator
August 14, 2026

Hi ​@SFQWXJ,

Do you have boot0 and boot1 connected to VDD ?

F4 boot modes

Aziz

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.