Skip to main content
Tobe
Senior III
January 28, 2025
Solved

Did i just brick my G431 with a failed FLASH option byte write?

  • January 28, 2025
  • 1 reply
  • 378 views

Hi,

i tried to write a option byte, which did not work i think.

A FLASH mass erase with the programmer does not work: "Error: Mass erase operation failed.Please verify flash protection"

Is it possible to brick a chip with a failed flash write operation?

 

 

 

while(READ_BIT(FLASH->SR, FLASH_SR_BSY));	// Wait to until no flash activity

if(HAL_FLASH_Unlock();		// Unlock FLASH

HAL_FLASH_OB_Unlock();	// Unlock Option bytes

WRITE_REG(FLASH->OPTR, 0xfbeff8aa);

SET_BIT(FLASH->CR, FLASH_CR_OPTSTRT);

while(READ_BIT(FLASH->SR, FLASH_SR_BSY));	// Wait to until no flash activity

 

 

Best answer by Tobe

Just found the cause:

Readout protection was set to "FF". Since i did not set it, i did not consider it. Everyday you learn something new....

 

Setting it to "AA" solved the issue.

1 reply

Tobe
TobeAuthorBest answer
Senior III
January 28, 2025

Just found the cause:

Readout protection was set to "FF". Since i did not set it, i did not consider it. Everyday you learn something new....

 

Setting it to "AA" solved the issue.