From 0f5ded6bc25c38ffc6ddfcd29cf141d15465af31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bl=C3=A1ha?= Date: Sat, 3 Oct 2026 11:38:22 +0200 Subject: [PATCH] RP2040 USB: clear stale SOF flag before remote wakeup --- os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.h | 1 + 1 file changed, 1 insertion(+) diff --git a/os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.h b/os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.h index 0b19beaa3d..9c6d33fbd4 100644 --- a/os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.h +++ b/os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.h @@ -417,6 +417,7 @@ struct USBDriver { do { \ /* remote wakeup doesn't trigger the wakeup interrupt, therefore \ * we use the SOF interrupt to detect resume of the bus. */ \ + (void)USB->SOFRD; \ USB->INTE |= USB_INTE_DEV_SOF; \ USB->SET.SIECTRL = USB_SIE_CTRL_RESUME; \ } while (false)