Commit 6cf3737f authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Kumar Gala
Browse files

ext/hal: stm32f2xx: 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: 61324

Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent 656cb012
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -48,3 +48,10 @@ Patch List:
     ext/hal/st/stm32cube/stm32f2xx/drivers/src/stm32f2xx_ll_usb.c
    ST Bug Tracker ID: 34714

    *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/stm32f2xx_ll_usb.c
     ST Bug tracker ID: 61324
+2 −2
Original line number Diff line number Diff line
@@ -768,7 +768,7 @@ HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uin
    count32b =  (len + 3U) / 4U;
    for (i = 0U; i < count32b; i++, src += 4U)
    {
      USBx_DFIFO(ch_ep_num) = *((__packed uint32_t *)src);
      USBx_DFIFO(ch_ep_num) = __UNALIGNED_UINT32_READ(src);
    }
  }
  return HAL_OK;
@@ -794,7 +794,7 @@ void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len)

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

  }
  return ((void *)dest);