From f5a95edef41627b0f5e2a61eb9d7f23ba3d9a4d7 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 27 Feb 2024 20:25:56 +1300 Subject: [PATCH] bootloader: fixup for imxrt Signed-off-by: Julian Oes --- platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c b/platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c index a166449fbcf2..f2eace527b2f 100644 --- a/platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c +++ b/platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c @@ -395,7 +395,7 @@ flash_func_sector_size(unsigned sector) return 0; } -bool flash_func_is_sector_blank(unsigned sector) +int flash_func_is_sector_blank(unsigned sector) { const uint32_t bytes_per_sector = flash_func_sector_size(sector); uint32_t *address = (uint32_t *)(IMXRT_FLEXSPI1_CIPHER_BASE + (sector * bytes_per_sector)); @@ -409,6 +409,8 @@ bool flash_func_is_sector_blank(unsigned sector) break; } } + + return !blank; } /*! @@ -428,7 +430,7 @@ flash_func_erase_sector(unsigned sector, bool force) return; } - if (force || !flash_func_is_sector_blank(sector)) { + if (force || flash_func_is_sector_blank(sector) != 0) { struct flexspi_nor_config_s *pConfig = &g_bootConfig; uintptr_t offset = ((uintptr_t) address) - IMXRT_FLEXSPI1_CIPHER_BASE;