Skip to content

Commit 3608cac

Browse files
committed
unlock flash when updating partition state
1 parent c06eda0 commit 3608cac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/update_flash.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,15 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
650650
* we need to set to UPDATING, otherwise there's no way to tell the
651651
* original direction of the update once interrupted */
652652
else if ((inverse == 0) && (fallback_allowed == 1)) {
653+
hal_flash_unlock();
654+
#ifdef EXT_FLASH
655+
ext_flash_unlock();
656+
#endif
653657
wolfBoot_set_partition_state(PART_UPDATE, IMG_STATE_UPDATING);
658+
#ifdef EXT_FLASH
659+
ext_flash_lock();
660+
#endif
661+
hal_flash_lock();
654662
}
655663

656664
return wolfBoot_delta_update(&boot, &update, &swap, inverse, resume);

0 commit comments

Comments
 (0)