Skip to main content
SDesh.1
Associate
July 5, 2021
Solved

Hello, I am Firmware engineer working on STM32G07 series board. While working with Flash memory I have unprotected Flash from Read and Write using STlinkUtility v 4.5.0, after this I am not able to Erase the Flash and hence not able to Debug and load

Hello I am Firmware engineer working on STM32G07 series board. While working with Flash memory I have unprotected Flash from Read and Write using STlinkUtility v 4.5.0, after this I am not able to Erase the Flash and hence not able to Debug and load as STM32 CubeIDe internally gives Erase command to clear Flash and Writes the new code on to board, Kindly suggest how can i fix this. see attached image for details.

This topic has been closed for replies.
Antoine OdonneBest answer
ST Employee
July 6, 2021

Dear Shiv,

The Flash signature you present looks like you have PCROP activated on the part on block or all of the memory.

In order to disable it, go back to RDP level 1 and set PCROP_RDP bit in OB as well.

Hope it might help,

Regards,

Antoine

12 replies

ST Employee
July 5, 2021

Dear SDesh,

May I ask you how you unprotected your flash? It should be by default in RDP level 0 and write unprotected. Did you try to connect to your device "under reset" ?

Thank you and regards,

Antoine

SDesh.1
SDesh.1Author
Associate
July 5, 2021

Hi Antoine,

I used the STM32 ST-Link Utility for unprotecting the Flash, from read & write in simultaneously. and did manual Reset to take changes into action

Regards,

Shiv

ST Employee
July 5, 2021

Shiv,

You mean you modify option bytes of your target by a user interface like Cube Programmer? Or by a loaded firmware onboard?

Manual reset wont update option bytes setting, you must perform power sequence or OBLaunch to do so.

May you try to connect to your target under reset?

Thank you and regards,

Antoine

Tesla DeLorean
Guru
July 5, 2021

Use the STM32 Cube Programmer tools, the Utilities have been deprecated and might not pair well with the G0​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SDesh.1
SDesh.1Author
Associate
July 6, 2021

Hi Tesla, Thanks you for your reply !!, I have downloaded the STM32 CubeProgrammer and tried to have a full Erase from it as well, but still its not able to Erase the flash, its giving the error to "Mass Erase operation failed, please verify flash Protection". Further tried to check for the Protection but both Read and Write Protection looks disabled, please see the images which can give some clue.

SDesh.1
SDesh.1Author
Associate
July 6, 2021

Here is another image for error

Antoine OdonneBest answer
ST Employee
July 6, 2021

Dear Shiv,

The Flash signature you present looks like you have PCROP activated on the part on block or all of the memory.

In order to disable it, go back to RDP level 1 and set PCROP_RDP bit in OB as well.

Hope it might help,

Regards,

Antoine

ST Employee
July 6, 2021

then regress to Level 0 :)

SDesh.1
SDesh.1Author
Associate
July 6, 2021

Thanks Antoine,

It worked :) Thanks for your suggestions.

Regards,

Shiv