From caaf002f09b3b4274a5f590c3ae4e760d09b1329 Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 16 Jul 2025 22:57:33 +0300 Subject: [PATCH] usb/dwc: Enable (unaligned) access to OTG_FIFO for ARMv8-M Main --- lib/usb/usb_dwc_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/usb/usb_dwc_common.c b/lib/usb/usb_dwc_common.c index 25848ba1..7025c2e8 100644 --- a/lib/usb/usb_dwc_common.c +++ b/lib/usb/usb_dwc_common.c @@ -240,7 +240,7 @@ uint16_t dwc_ep_write_packet(usbd_device *const usbd_dev, const uint8_t addr, co const uint32_t *buf32 = buf; /* Copy buffer to endpoint FIFO, note - memcpy does not work. * ARMv7M supports non-word-aligned accesses, ARMv6M does not. */ -#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__) for (size_t i = 0; i < len; i += 4) { REBASE(OTG_FIFO(ep)) = *buf32++; } @@ -293,7 +293,7 @@ uint16_t dwc_ep_read_packet(usbd_device *usbd_dev, uint8_t addr, void *buf, uint int i = 0; uint32_t *buf32 = buf; /* ARMv7M supports non-word-aligned accesses, ARMv6M does not. */ -#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__) for (i = len; i >= 4; i -= 4) { *buf32++ = REBASE(OTG_FIFO(0)); usbd_dev->rxbcnt -= 4;