Skip to main content
Associate II
April 22, 2026
Question

Segger J-Link Setup for Full Chip Erase in VSCode

  • April 22, 2026
  • 1 reply
  • 137 views

I'm using VSCode and J-Link for programming/flashing my STM23 MCUs.
Unfortunately using the default setup from SEGGER (https://kb.segger.com/J-Link_Visual_Studio_Code#Support),
J-Link only erases areas/pages needed.
I found no information about modifying the process of flashing.
Is there a way to modify the setup within VSCode in a way, to do a full chip erase when flasing by default?

Many thanks!

1 reply

Pavel A.
Super User
April 22, 2026

Do you want to fully erase the STM32 every time you download a program, or only one time or rarely? If the latter, you can erase with the JFlash GUI or CLI, or other tool. Erasing only the needed pages actually is a good feature.

Andrew Neil
Super User
April 22, 2026

@Pavel A. wrote:

Erasing only the needed pages actually is a good feature.


Indeed it is!

 

@ETX You can also use STM32CubeProgrammer to do a full-chip erase.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ETXAuthor
Associate II
April 24, 2026

Yes, of course it's a good feature for standard applications.
But for developement purpose, where you are using eeprom emulation on separate flash pages, there would often be the need for a full chip erase.
And this shouldn't be done with a different software tool, it should work with VSCode developement enviroment.

So my question was about a way how to setup VSCode to do this automatically or maybe with a configuration modification of the J-Link debugger with J-Link Commander.
Till now, I couldn't find any information how to change the flashing behavior of the Segger driver.