AP_Bootloader: check ecc error flags only in Flash Status registers

This commit is contained in:
bugobliterator 2024-07-25 12:14:26 +10:00 committed by Andrew Tridgell
parent 60c2e4278c
commit d8df0b716d
1 changed files with 2 additions and 2 deletions

View File

@ -553,11 +553,11 @@ void check_ecc_errors(void)
}
uint32_t ofs = 0;
while (ofs < BOARD_FLASH_SIZE*1024) {
if (FLASH->SR1 != 0) {
if (FLASH->SR1 & (FLASH_SR_SNECCERR | FLASH_SR_DBECCERR)) {
break;
}
#if BOARD_FLASH_SIZE > 1024
if (FLASH->SR2 != 0) {
if (FLASH->SR2 & (FLASH_SR_SNECCERR | FLASH_SR_DBECCERR)) {
break;
}
#endif