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

ext/hal: stm32f4xx: 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: 61325

Signed-off-by: default avatarErwan Gouriou <erwan.gouriou@linaro.org>
parent 6cf3737f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -53,3 +53,11 @@ Patch List:
     CMakeLists.txt
     drivers/include/stm32f4xx_hal_conf.h
     drivers/src/Legacy/stm32f4_hal_can.c

    *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/stm32f4xx_ll_usb.c
     ST Bug tracker ID: 61325
+2 −2
Original line number Diff line number Diff line
@@ -883,7 +883,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;
@@ -909,7 +909,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);