usbd_stm32f429_otgfs.c:450:21: warning: taking address of packed member of 'struct usb_string_descriptor' may result in an unaligned pointer value [-Waddress-of-packed-member]
450 | uint16_t *str = dsc->wString;
| ^~~
This can be fixed by changing the declaration of struct usb_string_descriptor in usb_std.h to include __attribute__ ((aligned (4)))
As such:
struct usb_string_descriptor {
uint8_t bLength; /**<\brief Size of the descriptor, in bytes.*/
uint8_t bDescriptorType; /**<\brief String descriptor type.*/
uint16_t wString[]; /**<\brief String data, as unicode characters or array of
* \ref USB_STD_LANGID codes. */
} __attribute__((packed)) __attribute__ ((aligned (4)));
Not sure if there are negative consequences to doing that.
When compiling I was getting this warning:
This can be fixed by changing the declaration of
struct usb_string_descriptor
inusb_std.h
to include__attribute__ ((aligned (4)))
As such:
Not sure if there are negative consequences to doing that.