summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2020-05-18 13:21:37 +0700
committerGitHub <[email protected]>2020-05-18 13:21:37 +0700
commit76bf96bcb0c12ba241ee4ecc175afb257e550d19 (patch)
tree6be8654ae1d2fd78e257783b2535455df2597d9c
parent17869f0999d275ec6a8830c95999998f0f84fd03 (diff)
parent550746097b81c07cdc2459371c809a3678fe1ff4 (diff)
Merge pull request #411 from hathach/fix-cast-align-warning
enable -Wcast-align
-rw-r--r--examples/device/net_lwip_webserver/Makefile3
-rw-r--r--examples/make.mk8
-rw-r--r--hw/bsp/adafruit_clue/board.mk4
-rw-r--r--hw/bsp/arduino_nano33_ble/board.mk4
-rw-r--r--hw/bsp/circuitplayground_bluefruit/board.mk4
-rw-r--r--hw/bsp/feather_nrf52840_express/board.mk4
-rw-r--r--hw/bsp/feather_nrf52840_sense/board.mk4
-rw-r--r--hw/bsp/feather_stm32f405/board.mk3
-rw-r--r--hw/bsp/nrf52840_mdk_dongle/board.mk4
-rw-r--r--hw/bsp/nutiny_sdk_nuc505/board.mk2
-rw-r--r--hw/bsp/pca10056/board.mk4
-rw-r--r--hw/bsp/pca10059/board.mk4
-rw-r--r--hw/bsp/pca10100/board.mk4
-rw-r--r--hw/bsp/raytac_mdbt50q_rx/board.mk4
-rw-r--r--hw/bsp/stm32f070rbnucleo/board.mk4
-rw-r--r--hw/bsp/stm32f072disco/board.mk4
-rw-r--r--hw/bsp/stm32f407disco/board.mk3
-rw-r--r--hw/bsp/stm32f411disco/board.mk3
-rw-r--r--hw/bsp/stm32f412disco/board.mk4
-rw-r--r--hw/bsp/stm32f746nucleo/board.mk4
-rw-r--r--hw/bsp/stm32f767nucleo/board.mk4
-rw-r--r--hw/bsp/stm32h743nucleo/board.mk1
-rw-r--r--src/common/tusb_common.h2
-rw-r--r--src/portable/nuvoton/nuc505/dcd_nuc505.c5
-rw-r--r--src/portable/nxp/transdimension/dcd_transdimension.c6
25 files changed, 54 insertions, 42 deletions
diff --git a/examples/device/net_lwip_webserver/Makefile b/examples/device/net_lwip_webserver/Makefile
index fa93cf87f..5279c49e2 100644
--- a/examples/device/net_lwip_webserver/Makefile
+++ b/examples/device/net_lwip_webserver/Makefile
@@ -6,6 +6,9 @@ CFLAGS += \
-DTCP_WND=2*TCP_MSS \
-DHTTPD_USE_CUSTOM_FSDATA=0
+# TODO rndis_reports.c and net_device cause cast algin warnings
+CFLAGS += -Wno-error=cast-align
+
INC += \
src \
$(TOP)/hw \
diff --git a/examples/make.mk b/examples/make.mk
index 449dc899d..2ea50753b 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -63,11 +63,9 @@ CFLAGS += \
-Wwrite-strings \
-Wsign-compare \
-Wmissing-format-attribute \
- -Wunreachable-code
-
-# This causes lots of warning with nrf5x build due to nrfx code
-# CFLAGS += -Wcast-align
-
+ -Wunreachable-code \
+ -Wcast-align
+
# Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -Og -ggdb
diff --git a/hw/bsp/adafruit_clue/board.mk b/hw/bsp/adafruit_clue/board.mk
index be8c5bf56..5290455cc 100644
--- a/hw/bsp/adafruit_clue/board.mk
+++ b/hw/bsp/adafruit_clue/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/arduino_nano33_ble/board.mk b/hw/bsp/arduino_nano33_ble/board.mk
index d217d37c0..0a25d0b19 100644
--- a/hw/bsp/arduino_nano33_ble/board.mk
+++ b/hw/bsp/arduino_nano33_ble/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/circuitplayground_bluefruit/board.mk b/hw/bsp/circuitplayground_bluefruit/board.mk
index be8c5bf56..5290455cc 100644
--- a/hw/bsp/circuitplayground_bluefruit/board.mk
+++ b/hw/bsp/circuitplayground_bluefruit/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/feather_nrf52840_express/board.mk b/hw/bsp/feather_nrf52840_express/board.mk
index 9f38d6796..7b2625cd4 100644
--- a/hw/bsp/feather_nrf52840_express/board.mk
+++ b/hw/bsp/feather_nrf52840_express/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/feather_nrf52840_sense/board.mk b/hw/bsp/feather_nrf52840_sense/board.mk
index be8c5bf56..5290455cc 100644
--- a/hw/bsp/feather_nrf52840_sense/board.mk
+++ b/hw/bsp/feather_nrf52840_sense/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCONFIG_GPIO_AS_PINRESET
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/feather_stm32f405/board.mk b/hw/bsp/feather_stm32f405/board.mk
index 2d1f8bb8d..8233c6608 100644
--- a/hw/bsp/feather_stm32f405/board.mk
+++ b/hw/bsp/feather_stm32f405/board.mk
@@ -9,6 +9,9 @@ CFLAGS += \
-DSTM32F405xx \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-align
+
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F4xx
diff --git a/hw/bsp/nrf52840_mdk_dongle/board.mk b/hw/bsp/nrf52840_mdk_dongle/board.mk
index 0ab5ff2e1..9ba04ba1f 100644
--- a/hw/bsp/nrf52840_mdk_dongle/board.mk
+++ b/hw/bsp/nrf52840_mdk_dongle/board.mk
@@ -8,8 +8,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCFG_TUSB_MCU=OPT_MCU_NRF5X
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/nutiny_sdk_nuc505/board.mk b/hw/bsp/nutiny_sdk_nuc505/board.mk
index 39df77d2c..5fb2119b8 100644
--- a/hw/bsp/nutiny_sdk_nuc505/board.mk
+++ b/hw/bsp/nutiny_sdk_nuc505/board.mk
@@ -19,13 +19,11 @@ SRC_C += \
hw/mcu/nuvoton/nuc505/StdDriver/src/i2s.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/pwm.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/rtc.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/sd.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/spi.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/spim.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/sys.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/timer.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/uart.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/usbd.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/wdt.c \
hw/mcu/nuvoton/nuc505/StdDriver/src/wwdt.c
diff --git a/hw/bsp/pca10056/board.mk b/hw/bsp/pca10056/board.mk
index b2f119626..0971e64c8 100644
--- a/hw/bsp/pca10056/board.mk
+++ b/hw/bsp/pca10056/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DCONFIG_GPIO_AS_PINRESET \
-DCFG_TUSB_MCU=OPT_MCU_NRF5X
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/pca10059/board.mk b/hw/bsp/pca10059/board.mk
index 8cce65eb9..72dfefdcb 100644
--- a/hw/bsp/pca10059/board.mk
+++ b/hw/bsp/pca10059/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DCONFIG_GPIO_AS_PINRESET \
-DCFG_TUSB_MCU=OPT_MCU_NRF5X
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/pca10100/board.mk b/hw/bsp/pca10100/board.mk
index 0ec8f0f69..5231aaf63 100644
--- a/hw/bsp/pca10100/board.mk
+++ b/hw/bsp/pca10100/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DCONFIG_GPIO_AS_PINRESET \
-DCFG_TUSB_MCU=OPT_MCU_NRF5X
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/raytac_mdbt50q_rx/board.mk b/hw/bsp/raytac_mdbt50q_rx/board.mk
index 0960ffe55..47bb430fc 100644
--- a/hw/bsp/raytac_mdbt50q_rx/board.mk
+++ b/hw/bsp/raytac_mdbt50q_rx/board.mk
@@ -8,8 +8,8 @@ CFLAGS += \
-DNRF52840_XXAA \
-DCFG_TUSB_MCU=OPT_MCU_NRF5X
-# nrfx issue undef _ARMCC_VERSION usage https://github.com/NordicSemiconductor/nrfx/issues/49
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
# due to tusb_hal_nrf_power_event
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
diff --git a/hw/bsp/stm32f070rbnucleo/board.mk b/hw/bsp/stm32f070rbnucleo/board.mk
index 8a073d524..8ae75dd96 100644
--- a/hw/bsp/stm32f070rbnucleo/board.mk
+++ b/hw/bsp/stm32f070rbnucleo/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_STM32F0
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F0xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F0xx
diff --git a/hw/bsp/stm32f072disco/board.mk b/hw/bsp/stm32f072disco/board.mk
index 522459d61..e6787b266 100644
--- a/hw/bsp/stm32f072disco/board.mk
+++ b/hw/bsp/stm32f072disco/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_STM32F0
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F0xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F0xx
diff --git a/hw/bsp/stm32f407disco/board.mk b/hw/bsp/stm32f407disco/board.mk
index 92e021538..df2ee4ba5 100644
--- a/hw/bsp/stm32f407disco/board.mk
+++ b/hw/bsp/stm32f407disco/board.mk
@@ -9,6 +9,9 @@ CFLAGS += \
-DSTM32F407xx \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-align
+
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F4xx
diff --git a/hw/bsp/stm32f411disco/board.mk b/hw/bsp/stm32f411disco/board.mk
index a5ea8cab2..5e0d6c3a0 100644
--- a/hw/bsp/stm32f411disco/board.mk
+++ b/hw/bsp/stm32f411disco/board.mk
@@ -9,6 +9,9 @@ CFLAGS += \
-DSTM32F411xE \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-align
+
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F4xx
diff --git a/hw/bsp/stm32f412disco/board.mk b/hw/bsp/stm32f412disco/board.mk
index 2a3ecbddd..5cf5e9b7a 100644
--- a/hw/bsp/stm32f412disco/board.mk
+++ b/hw/bsp/stm32f412disco/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DSTM32F412Zx \
-DCFG_TUSB_MCU=OPT_MCU_STM32F4
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=maybe-uninitialized
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-align
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F4xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F4xx
diff --git a/hw/bsp/stm32f746nucleo/board.mk b/hw/bsp/stm32f746nucleo/board.mk
index 7e070c1c5..95445486a 100644
--- a/hw/bsp/stm32f746nucleo/board.mk
+++ b/hw/bsp/stm32f746nucleo/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DSTM32F746xx \
-DCFG_TUSB_MCU=OPT_MCU_STM32F7
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=shadow
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-align -Wno-error=shadow
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F7xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F7xx
diff --git a/hw/bsp/stm32f767nucleo/board.mk b/hw/bsp/stm32f767nucleo/board.mk
index e5f0736df..fc638ddcb 100644
--- a/hw/bsp/stm32f767nucleo/board.mk
+++ b/hw/bsp/stm32f767nucleo/board.mk
@@ -9,8 +9,8 @@ CFLAGS += \
-DSTM32F767xx \
-DCFG_TUSB_MCU=OPT_MCU_STM32F7
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=shadow
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-align -Wno-error=shadow
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32F7xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32F7xx
diff --git a/hw/bsp/stm32h743nucleo/board.mk b/hw/bsp/stm32h743nucleo/board.mk
index 94cc44b5f..30e52dfcc 100644
--- a/hw/bsp/stm32h743nucleo/board.mk
+++ b/hw/bsp/stm32h743nucleo/board.mk
@@ -10,7 +10,6 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_STM32H7
# mcu driver cause following warnings
-CFLAGS += -Wno-error=maybe-uninitialized
ST_HAL_DRIVER = hw/mcu/st/st_driver/STM32H7xx_HAL_Driver
ST_CMSIS = hw/mcu/st/st_driver/CMSIS/Device/ST/STM32H7xx
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index 2389bfcd4..f144cda73 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -106,7 +106,7 @@ static inline uint16_t tu_max16 (uint16_t x, uint16_t y) { return (x > y) ? x :
static inline uint32_t tu_max32 (uint32_t x, uint32_t y) { return (x > y) ? x : y; }
// Align
-static inline uint32_t tu_align_n(uint32_t value, uint32_t alignment)
+static inline uint32_t tu_align(uint32_t value, uint32_t alignment)
{
return value & ((uint32_t) ~(alignment-1));
}
diff --git a/src/portable/nuvoton/nuc505/dcd_nuc505.c b/src/portable/nuvoton/nuc505/dcd_nuc505.c
index 02f0b35a6..e67b69ab2 100644
--- a/src/portable/nuvoton/nuc505/dcd_nuc505.c
+++ b/src/portable/nuvoton/nuc505/dcd_nuc505.c
@@ -182,7 +182,10 @@ static void dcd_userEP_in_xfer(struct xfer_ctl_t *xfer, USBD_EP_T *ep)
/* provided buffers are thankfully 32-bit aligned, allowing most data to be transfered as 32-bit */
while (countdown > 3)
{
- ep->EPDAT = *(uint32_t *)xfer->data_ptr;
+ uint32_t u32;
+ memcpy(&u32, xfer->data_ptr, 4);
+
+ ep->EPDAT = u32;
xfer->data_ptr += 4; countdown -= 4;
}
while (countdown--)
diff --git a/src/portable/nxp/transdimension/dcd_transdimension.c b/src/portable/nxp/transdimension/dcd_transdimension.c
index fcedc1c0c..7baf43e23 100644
--- a/src/portable/nxp/transdimension/dcd_transdimension.c
+++ b/src/portable/nxp/transdimension/dcd_transdimension.c
@@ -273,7 +273,8 @@ typedef struct {
dcd_qtd_t qtd[QHD_MAX] TU_ATTR_ALIGNED(32); // for portability, TinyUSB only queue 1 TD for each Qhd
}dcd_data_t;
-static dcd_data_t _dcd_data CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048);
+CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048)
+static dcd_data_t _dcd_data;
//--------------------------------------------------------------------+
// CONTROLLER API
@@ -478,7 +479,8 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t t
// Force the CPU to flush the buffer. We increase the size by 32 because the call aligns the
// address to 32-byte boundaries.
- CleanInvalidateDCache_by_Addr((uint32_t*) buffer, total_bytes + 31);
+ // void* cast to suppress cast-align warning, buffer must be
+ CleanInvalidateDCache_by_Addr((uint32_t*) tu_align((uint32_t) buffer, 4), total_bytes + 31);
//------------- Prepare qtd -------------//
qtd_init(p_qtd, buffer, total_bytes);