Call to boot_write_trailer() failing silently #1998
dillonj-sentient
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The call to
boot_write_trailer()
was failing silently in my project. This ended up being due toflash_area_align()
returning 16. (Writes to internal flash on the STM32U5 must be aligned to quadword addresses.) This is greater than the default value of 8 forBOOT_MAX_ALIGN
.This prevented the trailer information from writing to the secondary slot. This resulted in my swap type always being "temp", despite setting the permanent parameter in the call to
boot_set_pending_multi()
to1
.Initially, I was seeing the strange behavior of swap type being temp with no clue as to why this was the case. Defining
MCUBOOT_BOOT_MAX_ALIGN 16
in mcuboot_config.h ended up solving this problem. (I was actually trying to understand why my call toboot_set_next()
wasn't behaving as I expected.) I recommend aBOOT_LOG_ERR
to be added in the case thatalign > BOOT_MAX_ALIGN
so thatboot_write_trailer()
doesn't silently return-1
.Beta Was this translation helpful? Give feedback.
All reactions