From bdb8b5f3426198dab4b1d991ab6102ab4cb2949c Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Mon, 23 Apr 2018 17:58:05 -0500 Subject: [PATCH] Fix Kinetis USB disconnect When disconnecting in the middle of a setup packet USB stops working even after being re-connected. This is because the setup packet suspended endpoint events but nothing resumed endpoint events. This patch adds code to resume endpoint events in the reset handler. --- usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp b/usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp index 89fca0f81c..c8a55e1a66 100644 --- a/usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp +++ b/usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp @@ -565,6 +565,7 @@ void USBPhyHw::process() Data1 = 0x55555555; USB0->CTL |= USB_CTL_ODDRST_MASK; + USB0->CTL &= ~USB_CTL_TXSUSPENDTOKENBUSY_MASK; USB0->ISTAT = 0xFF; // clear all interrupt status flags USB0->ERRSTAT = 0xFF; // clear all error flags