Skip to content

Commit b70ae43

Browse files
authored
Merge pull request #60 from wolfSSL/self-update-bugfix
Fixed loop logic in bootloader update
2 parents e575224 + 9abc473 commit b70ae43

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/update_flash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ static void RAMFUNCTION wolfBoot_self_update(struct wolfBoot_image *src)
5151
hal_flash_unlock();
5252
wolfBoot_erase_bootloader();
5353
#ifdef EXT_FLASH
54-
while (pos < src->fw_size) {
55-
if (PART_IS_EXT(src)) {
54+
if (PART_IS_EXT(src)) {
55+
while (pos < src->fw_size) {
5656
uint8_t buffer[FLASHBUFFER_SIZE];
5757
if (src_offset + pos < (src->fw_size + IMAGE_HEADER_SIZE + FLASHBUFFER_SIZE)) {
5858
ext_flash_read((uintptr_t)(src->hdr) + src_offset + pos, (void *)buffer, FLASHBUFFER_SIZE);

0 commit comments

Comments
 (0)