STM32H755 Rev. V RDP Error when erasing flash sectors
Hi there,
Our application has a firmware update method that begins by erasing flash bank 2 sector by sector before writing the new firmware.
RDP level is set to 0, but this shouldn't be an issue as we're only erasing a sector.
Occasionally (Maybe 1 in 30 times) when beginning an update, the erase of sector 0 fails. Investigating further, the 'RDPERR' bit of FLASH_CR2 is set. The program continues to run, but the erase will continue to fail until a power-cycle.
I have also previously seen it fail with the 'RDSERR' being set, however we are not using the secure features either.
We have tried for weeks to reliably reproduce this issue, and we can't.
The method we use to start a flash sector erase, after unlocking the flash with HAL:
void eraseSectorBank2(uint32_t Sector)
{
FLASH->CR2 &= ~(FLASH_CR_PSIZE | FLASH_CR_SNB);
FLASH->CR2 |= FLASH_VOLTAGE_RANGE_3;
FLASH->CR2 |= (FLASH_CR_SER | (Sector << FLASH_CR_SNB_Pos) | FLASH_CR_START);
}Is there any known issue here, or anything we could have overlooked? I'm pretty confident that our erase / write process is generally correct as it works the other ~29/30 times!!
Many thanks,
Matt