cancel
Showing results for 
Search instead for 
Did you mean: 

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.

SDesh.1
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Antoine Odonne
ST Employee

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

View solution in original post

12 REPLIES 12
Antoine Odonne
ST Employee

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

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

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

Hi Antoine,

Yes I have modified the Option-Bytes from Level 1 to level 0, and have unselected Pages for Write unprotect, After Applying the changes, I can see the Protection level is set to Level 0, but now while performing Mass Erase, Getting the Error, I am not able to see 0xFF but instead there is value 0x80 at every byte. So not sure why this occured.which if further creating problem for Flashing new Code. I hope I am Clear? or I can share the Images which might give some clue.

Please let me know if I can provide some more Images or info.

Regards,

Shiv

Here is the Image of current Memory content. Not sure why there is this data at all locations.

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
Up vote any posts that you find helpful, it shows what's working..

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.

Here is another image for error

Antoine Odonne
ST Employee

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