Skip to main content
Ddeve.1
Associate
November 5, 2021
Question

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

  • November 5, 2021
  • 4 replies
  • 3743 views

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

4 replies

TDK
Super User
November 5, 2021

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
November 6, 2021

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
January 8, 2025

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
Technical Moderator
November 10, 2021

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 Accept as Solution on the reply which solved your issue or answered your question.
Associate
September 28, 2024

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