cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Sector erase operation has failed — STM32G0B1CCT6

AKG123
Associate III

 

Hello,

I am working with the STM32G0B1CCT6 MCU and facing an issue while flashing firmware using ST-LINK.

During the flashing process, I get the following error:

Error: Sector erase operation has failed at least for one of the existing specified sectors. Please verify flash memory protection. Warning: Connection to device 0x467 is lost

I have checked my hardware connections, and power supply seems fine. However, the erase operation still fails, and the device disconnects.

Could this be due to flash write protection, or some RDP (Readout Protection) setting?
Please help me resolve this issue.

I am attaching the screenshot of the error and the related project/file for reference.

Thank you!

1 REPLY 1
KDJEM.1
ST Employee

Hello @AKG123,

 

What is the value of RDP level?

Read, program and erase operations within the main flash memory area are possible with RDP Level 0.

Mass erase (full or partial) is only triggered by the RDP regression from Level 1 to Level 0. RDP level increase (Level 0 to Level 1, 1 to 2, or 0 to 2) does not cause any mass erase.

I recommend you reviewing RM0444 Rev 6 section 3.5 FLASH memory protection and verifying the erase conditions.

Thank you.

Kaouthar

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.