PCROP becoming enabled
We ran a batch of boards with an STM32F401CE on them (this was not the first run of these boards or using this processor).
After loading application code, about 10% of the boards became unresponsive. Looking into it we found in the option bytes on the bad boards that the SPRMOD bit, which enables PCROP on all sectors, was set. We don't set this bit anywhere in the application.
We do set the brown out level on power up with this code:
if(( FLASH_OB_GetBOR() & 0x0F ) != OB_BOR_LEVEL3 )
{
FLASH_OB_Unlock();
FLASH_ClearFlag( FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR );
FLASH_OB_BORConfig( OB_BOR_LEVEL3 );
FLASH_OB_Launch();
}...but that is the only time we update the option bytes and that code shouldn't touch the SPRMOD bit.
Any ideas what might be happening here?
I am able to remove the read/write protection with ST link, but I don't want to have to solder wires onto all these boards to unlock them.
