We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01cbc77 commit 3cc3d4fCopy full SHA for 3cc3d4f
src/bus.rs
@@ -431,6 +431,13 @@ impl<USB: UsbPeripheral> usb_device::bus::UsbBus for UsbBus<USB> {
431
}
432
433
434
+ // Delay a few cycles after selecting PHY before doing a core reset
435
+ // https://community.st.com/s/question/0D53W00000znL7jSAE/stm32h745-usbotg-intermittently-fails-to-respond-to-core-reset
436
+ #[cfg(not(feature = "cortex-m"))]
437
+ for _ in 0..500000 {};
438
+ #[cfg(feature = "cortex-m")]
439
+ cortex_m::asm::delay(25600);
440
+
441
// Perform core soft-reset
442
while read_reg!(otg_global, regs.global(), GRSTCTL, AHBIDL) == 0 {}
443
modify_reg!(otg_global, regs.global(), GRSTCTL, CSRST: 1);
0 commit comments