diff --git a/ports/stm32/usb.c b/ports/stm32/usb.c index defb2d8bc5..b73bfdc311 100644 --- a/ports/stm32/usb.c +++ b/ports/stm32/usb.c @@ -166,6 +166,7 @@ void pyb_usb_dev_deinit(void) { usb_device_t *usb_dev = &usb_device; if (usb_dev->enabled) { USBD_Stop(&usb_dev->hUSBDDevice); + USBD_DeInit(&usb_dev->hUSBDDevice); usb_dev->enabled = false; } }