We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e4ff3c commit 94ecf06Copy full SHA for 94ecf06
1 file changed
src/libwolfboot.c
@@ -768,12 +768,18 @@ void RAMFUNCTION wolfBoot_update_trigger(void)
768
/* Set the IMG_STATE_UPDATING flag and
769
* the trailer magic in cache before committing to flash
770
*/
771
+#ifndef FLAGS_HOME
772
offset = WOLFBOOT_SECTOR_SIZE - (sizeof(uint32_t) + 1);
-#ifdef FLAGS_HOME
773
+#else
774
/* If flags are stored in BOOT partition, take into account the offset
775
* of the flags used for the update partition too, to avoid erasing the
776
* sector.
777
778
+ #ifdef EXT_ENCRYPTED
779
+ offset = WOLFBOOT_SECTOR_SIZE - TRAILER_OVERHEAD;
780
+ #else
781
+ offset = WOLFBOOT_SECTOR_SIZE - (sizeof(uint32_t) + 1);
782
+ #endif
783
offset -= (PART_BOOT_ENDFLAGS - PART_UPDATE_ENDFLAGS);
784
#endif
785
NVM_CACHE[offset] = st;
0 commit comments