From f37af7cdb334c022a6ba608252adb4c611186b24 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Thu, 25 Jul 2024 12:14:26 +1000 Subject: [PATCH] AP_Bootloader: check ecc error flags only in Flash Status registers --- Tools/AP_Bootloader/support.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/AP_Bootloader/support.cpp b/Tools/AP_Bootloader/support.cpp index a7873fcb18924b..1dd7b1e77adf91 100644 --- a/Tools/AP_Bootloader/support.cpp +++ b/Tools/AP_Bootloader/support.cpp @@ -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