Skip to content

Commit

Permalink
nxp/imxrt_common/main:Fix Breakage from a9962dc
Browse files Browse the repository at this point in the history
  • Loading branch information
davids5 committed May 23, 2024
1 parent 4f64acb commit 8ad114e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Binary file modified boards/px4/fmu-v6xrt/extras/px4_fmu-v6xrt_bootloader.bin
Binary file not shown.
8 changes: 6 additions & 2 deletions platforms/nuttx/src/bootloader/nxp/imxrt_common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ flash_func_sector_size(unsigned sector)
}

/* imxRT uses Flash lib, not up_progmem so let's stub it here */
up_progmem_ispageerased(unsigned sector)
ssize_t up_progmem_ispageerased(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 Down Expand Up @@ -431,9 +431,13 @@ flash_func_erase_sector(unsigned sector, bool force)
return;
}

if (force || flash_func_is_sector_blank(sector) != 0) {
if (force || up_progmem_ispageerased(sector) != 0) {

struct flexspi_nor_config_s *pConfig = &g_bootConfig;

const uint32_t bytes_per_sector = flash_func_sector_size(sector);
uint32_t *address = (uint32_t *)(IMXRT_FLEXSPI1_CIPHER_BASE + (sector * bytes_per_sector));

uintptr_t offset = ((uintptr_t) address) - IMXRT_FLEXSPI1_CIPHER_BASE;
irqstate_t flags;
flags = enter_critical_section();
Expand Down

0 comments on commit 8ad114e

Please sign in to comment.