diff --git a/common/flash.c b/common/flash.c index 020dbd727e..d070e5f6b3 100644 --- a/common/flash.c +++ b/common/flash.c @@ -38,7 +38,7 @@ /* NOTE: It's not expected that RO and RW will support * differing PSTATE versions. */ #define PERSIST_STATE_VERSION 3 /* Expected persist_state.version */ -#define SERIALNO_MAX 30 +#define SERIALNO_MAX 28 /* Flags for persist_state.flags */ /* Protect persist state and RO firmware at boot */ @@ -53,6 +53,10 @@ struct persist_state { uint8_t reserved; /* Reserved; set 0 */ uint8_t serialno[SERIALNO_MAX]; /* Serial number. */ }; +/* written with flash_physical_write, need to respect alignment constraints */ +#ifndef CHIP_FAMILY_STM32L /* STM32L1xx is somewhat lying to us */ +BUILD_ASSERT(sizeof(struct persist_state) % CONFIG_FLASH_WRITE_SIZE == 0); +#endif #else /* !CONFIG_FLASH_PSTATE_BANK */ diff --git a/include/usb_descriptor.h b/include/usb_descriptor.h index 3c5352e452..1343e0d777 100644 --- a/include/usb_descriptor.h +++ b/include/usb_descriptor.h @@ -258,7 +258,7 @@ struct usb_setup_packet { #ifdef CONFIG_USB_SERIALNO /* String Descriptor for USB, for editable strings. */ -#define USB_STRING_LEN 30 +#define USB_STRING_LEN 28 struct usb_string_desc { uint8_t _len; uint8_t _type;