Skip to main content
DFlam
Associate
June 7, 2022
Solved

How to mass erase the external flash using STM32_Programmer_CLI

  • June 7, 2022
  • 1 reply
  • 3611 views

Hi all,

I realized my custom external loader for STM32CubeProgrammer and it works fine when used from the Programmer GUI.

I can program, erase ad read external flash.

Now I'd like to use the command line interface but I cannot find how to mass erase the external flash from CLI.

If I load a .HEX file for the external flash the affected sectors are erased and programmed perfectly, but issuing the -e all command anly erases the internal flash.

Since my .hex file contains only used external flash areas, I'd like to do a mass erase before writing so I'm sure that flash is clean before writing.

External mass erase is possible from GUI so I suppose it is also possibel from command line...

Any suggestion?

Thanks,

Davide

This topic has been closed for replies.
Best answer by Aziz BRIGUI

Hello @Community member​,

Thank you for posting,

You can achieve this by using the following command :

STM32_Programmer_CLI.exe -c port=swd -e all -el "Absolute path of your external loader"

Keep in mind that this command is only available when using SWD/JTAG.

I hope this helps.

Best regards,

Aziz

1 reply

Aziz BRIGUI
Aziz BRIGUIBest answer
Technical Moderator
June 30, 2022

Hello @Community member​,

Thank you for posting,

You can achieve this by using the following command :

STM32_Programmer_CLI.exe -c port=swd -e all -el "Absolute path of your external loader"

Keep in mind that this command is only available when using SWD/JTAG.

I hope this helps.

Best regards,

Aziz

In order 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.
RonnyBergner
Associate
April 24, 2024

How does erase all behave when i am passing my external loader binary?

Will it only erase the external flash, or also cause an erase of the internal flash?

Do i have to call an erase for external and internal flash separately?