cancel
Showing results for 
Search instead for 
Did you mean: 

How to mass erase the external flash using STM32_Programmer_CLI

DFlam
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Aziz BRIGUI
ST Employee

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.

View solution in original post

2 REPLIES 2
Aziz BRIGUI
ST Employee

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.

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?