0
\$\begingroup\$

I've created a project in CubeMX for my F7 Discovery. I followed instructions form here. However, in my Device Manager on Windows nothing appears. When I used precompiled code from link I was assured drivers installed on Windows works properly. MCU after checking this: if( hUsbDevice_0 ==NULL) returns from the function. What's wrong? Maybe I should use another function to enable something in USB module on MCU?

\$\endgroup\$

closed as unclear what you're asking by Scott Seidman, uint128_t, Peter Smith, Daniel Grillo, Olin Lathrop Apr 14 '16 at 10:56

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1
\$\begingroup\$

That's because from stm32f4-discovery link you gave, precompiled hex file has enabled USB clock and also PLL configuration is properly set to ensure 48MHz is enabled for USB, if you are using USB FS MODE.

In USB HS mode with external PHY, you don't need to take care about clock so much since clock reference is from PHY chip.

And let me introduce myself. My name is Tilen and I'm owner of that site you posted a link.

Have a nice day.

\$\endgroup\$
  • \$\begingroup\$ This is true, and as I discovered, the HAL does a very weak job of verifying that clocks are valid... rather it prefers to just silently fail under certain conditions. \$\endgroup\$ – Daniel Apr 12 '16 at 18:12
1
\$\begingroup\$

It's a pity that STMicroelectronics does not include clock enable code in their libraries. The solution is to enable USB OTG clock by calling __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); in a MX_USB_DEVICE_Init() routine or before.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.