From ef5ef95b4e313ab6231dcf79b13ea4e3c306a6b4 Mon Sep 17 00:00:00 2001 From: John Bland Date: Mon, 9 Dec 2024 13:47:54 -0500 Subject: [PATCH] fix comments --- src/libwolfboot.c | 2 +- src/update_flash.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libwolfboot.c b/src/libwolfboot.c index b22c9d6cf..17b4e0777 100644 --- a/src/libwolfboot.c +++ b/src/libwolfboot.c @@ -268,7 +268,7 @@ static int RAMFUNCTION nvm_select_fresh_sector(int part) } } finish: - /* Erase the non-selected partition */ + /* Erase the non-selected partition, requires unlocked flash */ addrErase -= WOLFBOOT_SECTOR_SIZE * (!sel); if (*((uint32_t*)(addrErase + WOLFBOOT_SECTOR_SIZE - sizeof(uint32_t))) != FLASH_WORD_ERASED) { diff --git a/src/update_flash.c b/src/update_flash.c index 5049ca378..332a053fe 100644 --- a/src/update_flash.c +++ b/src/update_flash.c @@ -947,7 +947,8 @@ void RAMFUNCTION wolfBoot_start(void) #endif #ifdef NVM_FLASH_WRITEONCE - /* nvm_select_fresh_sector needs unlocked flash in cases where */ + /* nvm_select_fresh_sector needs unlocked flash in cases where the unused + * sector needs to be erased */ hal_flash_unlock(); #ifdef EXT_FLASH ext_flash_unlock(); @@ -958,7 +959,6 @@ void RAMFUNCTION wolfBoot_start(void) updateRet = wolfBoot_get_partition_state(PART_UPDATE, &updateState); #ifdef NVM_FLASH_WRITEONCE - /* nvm_select_fresh_sector needs unlocked flash in cases where */ hal_flash_lock(); #ifdef EXT_FLASH ext_flash_lock();