stm32/mboot: Fix alignment of packed final buffer.

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>
pull/11469/head
Andrew Leech 2023-05-11 15:45:53 +10:00 zatwierdzone przez Damien George
rodzic ad216be5f1
commit f03ac04321
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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;