Is it OK to use "__PACKED" other than "__packed" in "cmsis_armcc.h"
I found that I have to change the define "__PACKED" to "__packed" in "cmsis_armcc.h"; otherwise, the following code in "stm32h7xx_II_usb.c" will crash on the second call to this function, if the "len" in the first call is 7 ( or might be other none 32-bit aligned number). I am wondering whether I do not configure the compiler correctly. It is Keil Compiler Version 5.
/**
* @brief USB_ReadPacket : read a packet from the RX FIFO
* @param USBx Selected device
* @param dest source pointer
* @param len Number of bytes to read
* @retval pointer to destination buffer
*/
void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len)
{
uint32_t USBx_BASE = (uint32_t)USBx;
uint32_t *pDest = (uint32_t *)dest;
uint32_t i;
uint32_t count32b = ((uint32_t)len + 3U) / 4U;
for (i = 0U; i < count32b; i++)
{
__UNALIGNED_UINT32_WRITE(pDest, USBx_DFIFO(0U));
pDest++;
}
return ((void *)pDest);
}
