stm32f7xx-hal icon indicating copy to clipboard operation
stm32f7xx-hal copied to clipboard

RngExt::init modifies RCC clock configuration

Open rfuest opened this issue 4 years ago • 1 comments

RngExt::init enables the main PLL, if it isn't already enabled. There are no checks that the PLL multiplication/division factors are correct or that a valid clock is supplied to the PLL.

To improve this I would suggest to remove the PLL related code from init and change it to take a &Clocks argument. Clocks contains a pll48clk_valid field, which could be used to check that a valid clock is supplied to the RNG.

rfuest avatar Jul 17 '21 18:07 rfuest

Good catch! Your suggestions sounds reasonable.

hannobraun avatar Jul 19 '21 11:07 hannobraun