mirror of https://github.com/wolfSSL/wolfBoot.git
Fix NVM_FLASH_WRITEONCE redundancy
Address of non-selected block to erase was shifted by one blockpull/287/head
parent
16bc109c06
commit
b401dae331
|
|
@ -187,7 +187,7 @@ static int nvm_select_fresh_sector(int part)
|
|||
}
|
||||
}
|
||||
/* Erase the non-selected partition */
|
||||
addr_align = (uint32_t)(base - ((!sel) * WOLFBOOT_SECTOR_SIZE))
|
||||
addr_align = (uint32_t)(base - ((1 + (!sel)) * WOLFBOOT_SECTOR_SIZE))
|
||||
& (~(NVM_CACHE_SIZE - 1));
|
||||
if (*((uint32_t*)(addr_align + WOLFBOOT_SECTOR_SIZE - sizeof(uint32_t)))
|
||||
!= FLASH_WORD_ERASED) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue