Skip to content

Commit cf48e63

Browse files
committed
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.
1 parent 0bd8401 commit cf48e63

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

usb/device/targets/TARGET_Freescale/USBPhy_Kinetis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ void USBPhyHw::process()
565565

566566
Data1 = 0x55555555;
567567
USB0->CTL |= USB_CTL_ODDRST_MASK;
568+
USB0->CTL &= ~USB_CTL_TXSUSPENDTOKENBUSY_MASK;
568569

569570
USB0->ISTAT = 0xFF; // clear all interrupt status flags
570571
USB0->ERRSTAT = 0xFF; // clear all error flags

0 commit comments

Comments
 (0)