Skip to content

Commit

Permalink
bootloader: fixup for imxrt
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes committed Feb 27, 2024
1 parent 9e0c7d9 commit f5a95ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -409,6 +409,8 @@ bool flash_func_is_sector_blank(unsigned sector)
break;
}
}

return !blank;
}

/*!
Expand All @@ -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;
Expand Down

0 comments on commit f5a95ed

Please sign in to comment.