Showing results for 
Search instead for 
Did you mean: 

Debug not working with relocated code with Cortex-Debug (Visual Studio Code)



Working on a STM32F407 MCu, I have a bootloader loaded at 0x0800 0000.

The bootloader then call an application loaded at 0x0802 0000. To do that, I have made the following modification in the application sources

  • In linker .ld file, change FLASH ORIGIN from 0x8000000 to 0x8020000 and change length.
  • In the system_stm32f4xx.c file
    • uncommented USER_VECT_TAB_ADDRESS
    • Set VECT_TAB_OFFSET to 0x20000

When running the bootloader, it perfectly launch the application.

I would like to debug the application. Using Visual Studio Code and Cortex Debug, when starting the launch sequence, it is not working.

The code is successfully loaded. Checking with STM32CubeProgrammer show that data has been written to 0x8020000.

How to tell the debbuger to start working at 0x8020000?

Thank you for your help.