2021-05-25 11:38 PM
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: I then took a look at the config with CubeProgrammer:
How is it possible to have 0xFF as RDP Byte?
Write 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.
Solved! Go to Solution.
2022-05-20 05:10 PM
@molecule.192g, please edit out from your post that long e-mail spam (history of replies)!
2022-11-25 03:05 PM
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
2023-04-04 03:09 AM
Hold Reset button while Connecting to the device in cubeprogramer. then full erase the internal flash. if using external flash use a programe that implement full chip erase.
2023-08-21 08:34 AM - edited 2023-08-21 08:48 AM
One of my STM32F730Z8T6 got corrupted for a mysterious reason and I get the "Mass erase operation failed. Please verify flash protection" when I try to erase it with:
STM32_Programmer_CLI -c port=SWD freq=4000 --erase all
This used to work on the same device. I toggled the RDP protection level option byte to 0xBB and back to 0xAA, to get my memory back in read/write mode, but the issue persists.
Oddly enough, clearing the memory by blocks still works perfectly ("Existing specified sectors are erased successfully. Protected sectors are not erased")
STM32_Programmer_CLI -c port=SWD freq=4000 --erase 0 1 2 3