I think this question relates to STM32 in general, but specifically the part in currently working on is a STM32L051. After stopping the CPU to stop mode, with I/O reconfigured is analog inputs to save power, I'd like to understand if there is a known proper sequence to configure the I/Os back as alternate function I/Os again. Take the example with an I2C peripheral for example, in stop mode the I2C peripheral is disabled, with the peripheral clock off, GPIOo clock off and GPIOs configured as analog inputs. I'd like to re-enable the I2C peripheral and reconfigure the I/Os without any glitches on the pins when I wake up again. I've tried a few different ways of doing this (in which order I things are done), but it seems there is a very short glitch in the I/Os pins. In most applications this is not an issue, but I'd like to learn if there is a known "proper" sequence that can be followed?