Skip to main content
geek12
Associate II
April 9, 2022
Question

Debug mode - Behaviour Debugging vs loading in flash memory in STM32H7

  • April 9, 2022
  • 8 replies
  • 2280 views

Hi everybody,

I'm working on a board with STM32H7. I want to understand why when I launch the debugger mode with the bootloader program. The program of the bootloader still on the memory flash of the STM32H7 after a restart (turning off the board) and I can then load the binary program (the application program) using the UART. However, when I launch the application program using the debugger mode when I restart the board out of the debugger mode just the bootloader program stay at the memory flash of the MCU and not the application program. Is there any explanation to such behaviour ? Or it's the settings linked to the debbuger mode ?

Thanks for you support.

This topic has been closed for replies.

8 replies

KnarfB
Super User
April 9, 2022

You're not telling what IDE, this is for STM32CubeIDE. There is a Debug Configuration... editor which opens when you press the down arrow near the de"bug" icon. In the Startup tab, a Start Address can be defined. The default is that the debugger does not change the settings in the MCU. But, you can specify a custom start address (of your app) and the corresponding interrupt vector table address here, matching the linker .ld file settings.

hth

KnarfB

geek12
geek12Author
Associate II
April 9, 2022

Thanks for your reply.

I have checked the settings of the debugger mode for the bootloader program an I find that the debuuger is set to the default start address and the debbugger settings for the app application is set as following : start address to set program counter at 0x08100004 and runs command to set $r13 = *0x08100000

set $pc = *0x08100004. So is there any explanation to this settings ? Thanks for your help.

KnarfB
Super User
April 9, 2022

This depends on how your bootloader and app divide the flash (and RAM) and on what you want to debug. In general, you are responsible to set the correct addresses here, matching your boot loader architecture and the code you want to debug.

hth

KnarfB