Skip to main content
yellowtomato
Associate II
May 26, 2021
Solved

STM32F722ZE Error: Mass erase operation failed. Please verify flash protection. STM32F722ZE

  • May 26, 2021
  • 12 replies
  • 22602 views

I debuged my software on the STM32F722ZE, when I suddenly lost connection to it. I tried to connect to it with ST-Link V2 and Segger J-Link.

Error message from J-Link commander is: Can not attach to CPU. Trying connect under reset. Connecting to CPU via connect under reset failed.

Error message from ST-Link V2: Error finishing flash operation. Failed to erase memoy.

See picture: 0693W00000APoBiQAL.pngI then took a look at the config with CubeProgrammer:

0693W00000APo8yQAD.pngHow is it possible to have 0xFF as RDP Byte?

0693W00000APoCHQA1.pngWrite protection is not active are all checked.

When I try to perform a mass erase I get Error: Mass erase operation failed.

How can I recover from this? Is it possible that I locked myself our by acciedent? I would say it is rather unlikely to do this while debugging. What else could have happend?

Thank you in advance for every answer.

0693W00000APo8oQAD.png

This topic has been closed for replies.
Best answer by Zaher

I just encountered the same error when I was trying to do "Erase Chip" from within CubeProgrammer. I have the latest version downloaded yesterday. This was on the STM32H747-DISCO board with STLink-V3.

Error message: "Mass erase operation failed. Please verify flash protection" but no protection has been applied to any sector of the flash whatsoever. I did full chip erase/programming dozens of times yesterday, but suddenly today it didn't work out. After spending some time trying to figure out what happened, I found that the problem lies in the FW of the STLINK. One of the demo projects opened in the IDE asked me to upgrade its firmware, which I did. After that, the problem appeared.

Here's what I did to solve it:

1- Open ST-Link Utility

2- From ST-LINK drop down menu go to > Firmware update

3- Click on Device Connect

4- Make sure MCO output is set to "Default (HSI/2 8MHz)

5- Click "yes>>>>" to upgrade FW and restart the tool

That's it. Now, I can do full chip erase in both of ST-Link Utility and CubeProgrammer.

Zaher

12 replies

ST Technical Moderator
May 27, 2021

Hello @yellowtomato​ ,

Let me first welcome you to the STM32 Community =)

I added the right topics to your question in order to increase its chance to be reviewed by our experts.

You might try updating the STLinkV2 firmware.

What is the release of Cubeprogrammer used ? Make sure to use and test with the latest STM32CubeProgrammer V 2.7.0.

Then, please keep me informed about your update.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
yellowtomato
Associate II
May 27, 2021

Hello,

thank you for the welcome.

I already used  STM32CubeProgrammer V 2.7.0. I updated the ST-Link to V2.J38.S7 and tested again. This did not change anything.

Houda GHABRI
ST Employee
May 27, 2021

Hi @yellowtomato​ ,

Can you measure the power supply of the board ?

This behavior is typical when the VDD power supply is drops down.

Houda

yellowtomato
Associate II
May 27, 2021

Power Supply should be okay. I can not see it dropping down. I use the same powe supply for weeks now and before the issue I never had any problems with it. Should I measure the power supply at the MCU? Maybe something happened to the board.

Tesla DeLorean
Guru
May 27, 2021

Measure voltages at VDD, VDDA, and VCAP pins

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Houda GHABRI
ST Employee
May 27, 2021

Hi,

yes exactly you should measure the the power supply at the MCU.

Houda

yellowtomato
Associate II
May 28, 2021

I measured this when the ST-Link was not attached: VDDA = 3.27V ; VDD= 3,27V ; VCAP = 1,221V

edit: should I message the what happens when I try to connect the debugger?

SN.1
Associate
February 17, 2022

Hi, In continuation to the error I am using STM32L4R9I with macronix Octa flash and I am getting the same error "Mass erase operation failed." is their any feedback from ST team

Lep
Senior
May 18, 2022

Did you solve the problem? I have similir problem:face_with_tears_of_joy:

Peter Chang
Associate
May 20, 2022

Dear Lep,

I never face to this problem.

If you can provide a failure system to me then I can help to solve it.

Thanks & best regards !

Peter Chang
Associate
February 18, 2022

MX25LM51245G has a RESET# pin. Please make sure this pin is in high stage.

Freedom_Neo
Senior
March 7, 2022

Did you solve the problem? I have similir problem

MCU: STM32H7B3IIT6

IDE: STM32CubeIDE Version: 1.8.0

GUI: TouchGFX Version: 4.18.1

SDRAM: IS45S16800F-7CTLA1-TR

FLASH: MX25LM51245GMI00

yellowtomato
Associate II
March 7, 2022

I am sorry I could not solve it.

Freedom_Neo
Senior
March 7, 2022

Have ST teams done any work on this issue? @Imen DAHMEN​ @Houda GHABRI​ I have this like problem.

Houda GHABRI
ST Employee
March 7, 2022

Hi ,

I already check this issue and we are not able to reproduce it , The mass erase is done correctly in STM32F722ZE ST board.

Let's check again if we have the same scenario :

  • Is it an external Flash Erase or the internal ?
  • Can you please also share the option bytes state of a failing board, a full dump of Option Bytes can be done with CLI command : STM32_Programmer_CLI.exe -c port=swd -ob displ

Houda

Freedom_Neo
Senior
March 7, 2022

Hi @Houda GHABRI​ ,

I have problem with external Flash Erase.

You can see detail below post.

https://community.st.com/s/question/0D53W00001PXEgKSAX/how-external-octo-spi-flash-activete-for-custom-board-design

CChri.5
Associate II
April 2, 2022

I currently face this issue with my stm32h745i disco. External flash cant be erased. Is there any fix for this?

Tesla DeLorean
Guru
April 3, 2022

>>I currently face this issue with my stm32h745i disco. External flash cant be erased. Is there any fix for this?

Which One? This thread has veered off topic, please open a NEW thread stating your exact issue, with supporting error messages and screen shots. Perhaps with Logs at Level 3.

The external loader should be able to erase the QSPI memory.

Make sure you're using the most current version of STM32Cube Programmer, and selected the correct external loader

STM32CubeProgrammer_v2.10.0\bin\ExternalLoader\MT25TL01G_STM32H745I-DISCO.stldr

>>Is there any fix for this?

You could erase the QSPI from your own application, and measure the time it takes.

Previous

https://community.st.com/s/question/0D53W00001PoUHASA3/stm32h745idisco-bricked-no-connection-even-with-boot1

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Zaher
ZaherBest answer
Senior II
November 25, 2022

I just encountered the same error when I was trying to do "Erase Chip" from within CubeProgrammer. I have the latest version downloaded yesterday. This was on the STM32H747-DISCO board with STLink-V3.

Error message: "Mass erase operation failed. Please verify flash protection" but no protection has been applied to any sector of the flash whatsoever. I did full chip erase/programming dozens of times yesterday, but suddenly today it didn't work out. After spending some time trying to figure out what happened, I found that the problem lies in the FW of the STLINK. One of the demo projects opened in the IDE asked me to upgrade its firmware, which I did. After that, the problem appeared.

Here's what I did to solve it:

1- Open ST-Link Utility

2- From ST-LINK drop down menu go to > Firmware update

3- Click on Device Connect

4- Make sure MCO output is set to "Default (HSI/2 8MHz)

5- Click "yes>>>>" to upgrade FW and restart the tool

That's it. Now, I can do full chip erase in both of ST-Link Utility and CubeProgrammer.

Zaher