Skip to main content
Ddeve.1
Associate
Nov 5, 2021 9:08 AM UTC
Question

How to clear the total Chip when Reprogramming the MCU; Using STM32CubeIde and a Segger Jlink ;

I use the STM32CubeIde and the Segger J-link program tool.

I've noticed that when reprogramming only the sectors where the program comes are reflashed.

Since I also use other secoters for data storage, would I also want to delete/clear these when reprogramming the mcu?

How can I set the STM32CubeIde environment to erase the entire flash before programming with the segger J link tool (debug/release)?

Regards,

diederik

This topic has been closed for replies.

5 replies

TDK
Nov 5, 2021 1:08 PM UTC

Some options here: You may need to modify them for the equivalent JLink commands/tools.

https://community.st.com/s/question/0D50X0000Bh8tmx/how-to-erase-flash-before-programming-with-stm32cubeide-solved

"If you feel a post has answered your question, please click ""Accept as Solution""."
Ddeve.1
Ddeve.1Author
Associate
Nov 6, 2021 5:18 PM UTC

I think this works for a ST link debugger connection ; unfortunately not for a Segger Jlink?!

When adding "monitor flash mass_erase" to the debug configuration -> Initialization statup :

0693W00000GWgKQQA1.jpgI get the following error :

0693W00000GWgKaQAL.jpg 

Any suggestions?

diederik

Markus Rudolf
Associate III
Jan 8, 2025 4:55 PM UTC

Try "monitor flash erase" instead. This works for me here with Jlink 8.12 and CubeIDE 1.17.0 (at least when I issue the commands manually)

Markus

Amel NASRI
ST Technical Moderator
Nov 10, 2021 2:15 PM UTC

Hi @Ddeve.1​ ,

In the user manual UM2609 STM32CubeIDE user guide, there is a dedicated paragraph "Debug using SEGGER J-Link".

I suggest that you refer to it.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Associate
Sep 28, 2024 12:17 AM UTC

Is there a way to do this if you do not have the SEGGER J-Link and just the ST-Link V2?