Skip to content

Commit 9769ac3

Browse files
committed
[stm32] Fix clock enable for internal PHYC
1 parent 13fe91a commit 9769ac3

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/modm/platform/usb/stm32/module.lb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def generate_instance(env, port, otg=False):
6767
"port": port,
6868
"peripheral": "Usbotg{}".format(port) if otg else "Usb",
6969
"is_otg": otg,
70+
"is_phyc": port == "hs" and not is_ulpi,
7071
"is_remap": irq_data["is_remap"],
7172
"irqs": irq_data["port_irqs"][port],
7273
"target": env[":target"].identifier,

src/modm/platform/usb/stm32/usb.hpp.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public:
4343
#endif
4444
%% endif
4545
Rcc::enable<Peripheral::{{ peripheral }}>();
46+
%% if is_phyc
47+
Rcc::enable<Peripheral::Usbotghsulpi>();
48+
RCC->APB2ENR |= RCC_APB2ENR_OTGPHYCEN; __DSB();
49+
%% endif
4650
%% if is_remap
4751
SYSCFG->CFGR1 |= SYSCFG_CFGR1_USB_IT_RMP;
4852
%% endif

0 commit comments

Comments
 (0)