diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index 1681d641..b8353b7c 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -216,10 +216,11 @@ void dcd_init (uint8_t rhport) USB->ISTR &= ~(USB_ISTR_ALL_EVENTS); // Clear pending interrupts - // Clear all EPREG - for(uint16_t i=0; i<8; i++) + // Reset endpoints to disabled + for(uint i=0; iDADDR = 0u; // disable USB peripheral by clearing the EF flag // Clear all EPREG (or maybe this is automatic? I'm not sure) - for(uint16_t i=0; i<8; i++) + for(uint i=0; i