Commit 7d00359e authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Kumar Gala
Browse files

ext/hal: stm32l4xx: Use of (__packed uint32_t *) produces warnings



Using Zephyr SDK 0.10.0-rc2, GNUCC 8.2.0 is used and
(__packed uint32_t *) are now generating warnings..
Replace with CMSIS macros __UNALIGNED_UINT32_READ and
__UNALIGNED_UINT32_WRITE

ST internal reference: 61328

Fixes #13237

Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent 162eb4eb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -63,3 +63,12 @@ Patch List:
    Impacted files:
     drivers/include/stm32l4xx_ll_exti.h
    ST Bug tracker ID: 55275


    *Use of (__packed uint32_t *) produces warning
      Using GNU 8.2.0, (__packed uint32_t *) generates warning.
      Replace with CMSIS macros __UNALIGNED_UINT32_READ and
      __UNALIGNED_UINT32_WRITE.
     Impacted files:
      drivers/include/stm32l4xx_ll_usb.c
     ST Bug tracker ID: 61328
+2 −2
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@ HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uin
  count32b = ((uint32_t)len + 3U) / 4U;
  for (i = 0U; i < count32b; i++)
  {
    USBx_DFIFO((uint32_t)ch_ep_num) = *((__packed uint32_t *)pSrc);
    USBx_DFIFO((uint32_t)ch_ep_num) = __UNALIGNED_UINT32_READ(pSrc);
    pSrc++;
  }

@@ -767,7 +767,7 @@ void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len)

  for (i = 0U; i < count32b; i++)
  {
    *(__packed uint32_t *)pDest = USBx_DFIFO(0U);
    __UNALIGNED_UINT32_WRITE(pDest, USBx_DFIFO(0U));
    pDest++;
  }