Skip to content

Commit

Permalink
stm32/mboot: Fix alignment of packed final buffer.
Browse files Browse the repository at this point in the history
Once all the firmware has been flashed and the final signatures checked,
mboot writes the "all good" byte into the header of the application.  This
step uses the buffer firmware_head which, if unaligned in the build, fails
when cast to a uint64_t* in flash.c.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
  • Loading branch information
pi-anl authored and dpgeorge committed May 19, 2023
1 parent ad216be commit f03ac04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/stm32/mboot/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static uint8_t uncompressed_buf[MBOOT_PACK_GZIP_BUFFER_SIZE] __attribute__((alig
// Buffer to hold the start of the firmware, which is only written once the
// entire firmware is validated. This is 8 bytes due to STM32WB MCUs requiring
// that a double-word write to flash can only be done once (due to ECC).
static uint8_t firmware_head[8];
static uint8_t firmware_head[8] __attribute__((aligned(8)));

// Flag to indicate that firmware_head contains valid data.
static bool firmware_head_valid;
Expand Down

0 comments on commit f03ac04

Please sign in to comment.