cancel
Showing results for 
Search instead for 
Did you mean: 

When an STM32 microcontroller is debuged, the probram being debugged is stored in the Flash?

SegmentFault
Associate II

Hello,

When an STM32 microcontroller is debugged using ST-LINK and STM32CubeID, the program that is being debug is burn in the Flash?

In other words, when I debug a program in STM32 microcontroller, the program previously stored in the Flash is overwritten?

To sum up. My doubt is about if I can flash the microcontroller through STM32CubeIDE or it is necessary using the programing utility to flash the STM32.

Regards,

6 REPLIES 6
Uwe Bonnes
Principal III

You can debug programs running in flash and running in RAM. When running in RAM you have infinite breakpoints, when running in flash you are restricted to the number of flash breakpoints that the MCU debug unit provides.

And how I can select if the debug is from FLASH or from RAM in STM32CubeIDE?

PWilk.2
Associate II

Yes, the program that was in flash is overwritten with the one being debugged using ST-LINK and STM32CubeIDE.

It's in FLASH by default. To put it into RAM you would need to change the linker script. This is not typically done.

If you feel a post has answered your question, please click "Accept as Solution".

Only for curiosity, what is the modification that linker scripts requires in order to put the program debugged in RAM?

You need to target the code to ram, but flash it to flash. On start, you need copy from flash to RAM.