STM32H7xx: PLL3 as clock for I2C kills USB
Another issue found, potentially in HAL drivers (HAL_RCCEx_PeriphCLKConfig):
I try to use PLL3R for I2C clock:
PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_PLL3; //USB will FAIL!!!
If I do this - my
USB is dead
(using also PLL3, PLL3Q):PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3;
It works just with:
PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_D2PCLK1;
Conclusion:
it looks like a bug in HAL driver functions:
if a PLL output is used as clock source, even they have 3 clock outputs for peripherals (P, Q, R):
==> JUST
ONE
PLL clock output can be used for peripherals!or: if more then one 'or-ed' macros for same PLL are not zero - just one config seems to win (or they kill each other).So, you CANNOT use a PLL with
MORE THEN ONE
clock output for peripheral clocks!(similar to the same issue with SDMMC1: it cannot use PLL2 - if PLL2 is already used for SPI clocks, the HAL driver code (or chip ?) seems to make it exclusive to 'just one PLL clock output is usable').