While using PWM output with different periods and duty cycles I observed glitches in the generated output signals. Even though the pwm and pwm_hz methods first enable auto reload preloads in CR1, the final call of self.tim.start_pwm() uses a write to CR1, which clears the ARPE bit again!