stm32-rs / stm32g0xx-hal

Peripheral access API for STM32G0 series microcontrollers
Apache License 2.0
73 stars 51 forks source link

Make sure system isn't clocked from PLL before disabling it #118

Closed davidlattimore closed 2 years ago

davidlattimore commented 2 years ago

Without this change, the following code results in the second call to freeze never returning - it gets stuck in the while loop that waits for the PLL to turn off (while self.cr.read().pllrdy().bit_is_set() {}).

        let rcc = dp.RCC.constrain();
        let rcc = rcc.freeze(hal::rcc::Config::pll());
        let rcc = rcc.freeze(hal::rcc::Config::pll());
andresv commented 2 years ago

Good stuff coming from you.