aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-06-03 01:27:53 +0000
committerGitHub <[email protected]>2023-06-03 01:27:53 +0000
commitf2c2536cf3d67e4e28616f631b6bdde789b15560 (patch)
treed218db0362ace020a176e54c3909fd9948a44bd2
parentd414f4e4f7f243b4e52e6550ca616c180d731774 (diff)
parent3539dd7d4cad23b1bdf7edbf7811fa2cd1755e72 (diff)
Merge pull request #1529 from sentry-sync/1528-stm32f7-usb-hs
Fix #1528 HS USB on STM32F7
-rw-r--r--embassy-stm32/src/usb_otg/usb.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/embassy-stm32/src/usb_otg/usb.rs b/embassy-stm32/src/usb_otg/usb.rs
index c7f19f6e9..e602bcb70 100644
--- a/embassy-stm32/src/usb_otg/usb.rs
+++ b/embassy-stm32/src/usb_otg/usb.rs
@@ -828,6 +828,30 @@ impl<'d, T: Instance> embassy_usb_driver::Bus for Bus<'d, T> {
828 critical_section::with(|_| crate::pac::PWR.cr2().modify(|w| w.set_usv(true))); 828 critical_section::with(|_| crate::pac::PWR.cr2().modify(|w| w.set_usv(true)));
829 } 829 }
830 830
831 #[cfg(stm32f7)]
832 {
833 // Enable ULPI clock if external PHY is used
834 let ulpien = !self.phy_type.internal();
835 critical_section::with(|_| {
836 crate::pac::RCC.ahb1enr().modify(|w| {
837 if T::HIGH_SPEED {
838 w.set_usb_otg_hsulpien(ulpien);
839 } else {
840 w.set_usb_otg_hsen(ulpien);
841 }
842 });
843
844 // Low power mode
845 crate::pac::RCC.ahb1lpenr().modify(|w| {
846 if T::HIGH_SPEED {
847 w.set_usb_otg_hsulpilpen(ulpien);
848 } else {
849 w.set_usb_otg_hslpen(ulpien);
850 }
851 });
852 });
853 }
854
831 #[cfg(stm32h7)] 855 #[cfg(stm32h7)]
832 { 856 {
833 // If true, VDD33USB is generated by internal regulator from VDD50USB 857 // If true, VDD33USB is generated by internal regulator from VDD50USB