AnsweredAssumed Answered

STM32F446: configure PLLSAI for 48MHz (USB) clock

Question asked by martin on Sep 14, 2015
Latest reply on Sep 16, 2015 by martin
I'm working on a new board that uses the STM32F446 running at 180MHz. The board uses an external 16MHz oszillator and I would like to use "PLLSAIP" for the 48MHz USB clock. The clock configuration from STM32CubeMX can be seen below:


To configure the clock, I modified the "system_stm32f4xx.c" file from the STM32 standard peripheral library. I.e., I added the following to the end of "SetSysClock()":

#if defined(STM32F446xx)
  /* Configure 48MHz clock for USB */
#endif /* STM32F446xx */where:
#define PLLSAI_M      8
#define PLLSAI_N      192
#define PLLSAI_P      8
#define PLLSAI_Q      2
The parameters for the main PLL are as follows:

#define PLL_M      8
#define PLL_N      180
#define PLL_P      2
#define PLL_Q      2
#define PLL_R      2

The entire file can be found here. The Code runs on the target, but it doesn't get detected by USB when connected to a computer. I'm fairly sure that it is not a hardware problem, as I can communicate with the STM bootloader over USB. Also, I suspect the problem is with the clock initialization as the code is otherwise identical to code I'm using successfully with an STM32F405. Last, note that while the STM32CubeMx software can generate code to initialize the 48MHz clock on the STM32F446, I would not like to use it as it uses the HAL which I don't need for anything else.

Does anyone have an idea what could be wrong with the code above?