cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Discovery CubeMX and USB

ptracton
Associate II
Posted on December 05, 2017 at 22:33

I am setting up a USB OTG based project on the STM32F4 Discovery Board.  I am using STM32CubeMX 4.23.0 and STM32Cube_FW_F4_v1.18.0.  This is the same set up on my Windows 10 and Linux Mint 18.2 PCs and both have the same error.

The clock configuration tab is always indicating that the clock set up is in error.  In the PLL Source Mux,  the HSI input is selected and has a red box around it with the message 'PLL Mux should have HSE as input selected'.  The HSE button is, of course, grayed out.  It generates the code but I get warnings about an invalid clock configuration.

Is this a problem with STM32CubeMX?  Is there actually an invalid clock configuration?  Is the generated code safe to use?

#stm32f4-discovery #usb #stmcubemx
1 ACCEPTED SOLUTION

Accepted Solutions
Naoaki Kagotani
Associate
Posted on December 06, 2017 at 06:33

It is necessary to set 'High Spedd clock(HSE)' to 'Crystal/Ceramic Resonator' with RCC on the Pinout tab.

HSI is not accurate and can not be used for USB.

View solution in original post

2 REPLIES 2
Naoaki Kagotani
Associate
Posted on December 06, 2017 at 06:33

It is necessary to set 'High Spedd clock(HSE)' to 'Crystal/Ceramic Resonator' with RCC on the Pinout tab.

HSI is not accurate and can not be used for USB.

ptracton
Associate II
Posted on December 06, 2017 at 06:56

Thanks!  That did it.  I did not know about setting the HSE in the RCC pinout.