File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -763,10 +763,11 @@ void RAMFUNCTION wolfBoot_update_trigger(void)
763763 hal_flash_erase (lastSector , SECTOR_FLAGS_SIZE );
764764#else
765765 selSec = nvm_select_fresh_sector (PART_UPDATE );
766- lastSector -= selSec * WOLFBOOT_SECTOR_SIZE ;
767- XMEMCPY ( NVM_CACHE , ( uint8_t * ) lastSector , WOLFBOOT_SECTOR_SIZE );
766+ XMEMCPY ( NVM_CACHE , ( uint8_t * ) lastSector - WOLFBOOT_SECTOR_SIZE * selSec ,
767+ WOLFBOOT_SECTOR_SIZE );
768768 /* write to the non selected sector */
769- hal_flash_erase (lastSector - WOLFBOOT_SECTOR_SIZE * !selSec , WOLFBOOT_SECTOR_SIZE );
769+ hal_flash_erase (lastSector - WOLFBOOT_SECTOR_SIZE * !selSec ,
770+ WOLFBOOT_SECTOR_SIZE );
770771 hal_flash_write (lastSector - WOLFBOOT_SECTOR_SIZE * !selSec , NVM_CACHE ,
771772 WOLFBOOT_SECTOR_SIZE );
772773 /* erase the previously selected sector */
You can’t perform that action at this time.
0 commit comments