cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 - Reset during write protection causes read protection

AEsqu.1
Associate

Hi,

I am working with a STM32F7 and I am setting write protection in some memory sectors.

If, for any reason, a reset occurs (SW or HW reset) or there is a power outage while the write protection is being configured (around 300ms time window), the whole memory gets read-protected (RDP level 1) and the boot addresses (BOOT_ADD0 and BOOT_ADD1) in the option bytes get cleared to 0xFFFF and 0xFFFF (screenshot attached shows the option bytes after it happens).

Is it normal that setting the write protection takes that long? Is there any way to prevent that the option bytes get corrupted if a reset happens during that time frame?

Thanks in advance for your help,

Arturo.

2 REPLIES 2
MCasi.1
Associate

I have also seen this.

This happens if a reset occurs during calling:

HAL_FLASH_OB_Launch()

Specifically, when this line is being executed:

  /* Set the OPTSTRT bit in OPTCR register */
  FLASH->OPTCR |= FLASH_OPTCR_OPTSTRT;

I have also seen the complete flash memory deleted after this.

I know you should not reset when updating the option bytes, but it can happen, specially when it takes too long to update. Is this expected behavior?

ESten.1
Associate

Is there no solution to this issue?