Skip to main content
ham10za
Associate II
September 22, 2019
Solved

Hello, please i was using the function RCC_OTGFSCLKConfig to initilize my clock sources for usb on stm32f1 now am using stm32f4 so i want to know if there is an equivalent function for this on the rcc library Best regards,

  • September 22, 2019
  • 3 replies
  • 993 views

..

This topic has been closed for replies.
Best answer by Tesla DeLorean

I don't know what F4 part you are using. Most only need that if you use high speed parts, like at 180 MHz, where the VCO won't divide down into 48 MHz naturally. The classic F2/F4 parts can only use the PLL-Q tap.

Perhaps looks a USB Device examples provided in the HAL for F429 or F446 type processors, if you're using those.

3 replies

Tesla DeLorean
Guru
September 22, 2019

The Generic F4 pulls the 48 MHz from the Q Tap of the PLL

ie 336 / 7 = 48 where 336 / 2 = 168 from the P Tap

 RCC_OscInitStruct.PLL.PLLN = 336; // VCO from 1 MHz comparison frequency, ie (HSE / M)

 RCC_OscInitStruct.PLL.PLLP = 2; // CPU

 RCC_OscInitStruct.PLL.PLLQ = 7; // USB

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ham10za
ham10zaAuthor
Associate II
September 23, 2019

thanks for your reply Clive, so should i also configure the RCC_DCKCFGR2 by configuring the SDIO/USBFS clock selection bit or just clocking the RCC_AHB2Periph_OTG_FS with the AHB2 is sufficient in order to use my usb driver properly?

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
September 23, 2019

I don't know what F4 part you are using. Most only need that if you use high speed parts, like at 180 MHz, where the VCO won't divide down into 48 MHz naturally. The classic F2/F4 parts can only use the PLL-Q tap.

Perhaps looks a USB Device examples provided in the HAL for F429 or F446 type processors, if you're using those.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..