diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index f280187e5..e0b151142 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs @@ -32,6 +32,7 @@ impl<'d, T: Instance> I2c<'d, T> { unborrow!(scl, sda); T::enable(); + T::reset(); unsafe { scl.set_as_af(scl.af_num(), AFType::OutputOpenDrain); diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index 5e9de8fd3..f3714cbcb 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs @@ -53,6 +53,7 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> { unborrow!(irq, scl, sda, tx_dma, rx_dma); T::enable(); + T::reset(); unsafe { scl.set_as_af(scl.af_num(), AFType::OutputOpenDrain); diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index 0466065f1..caea8d71b 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs @@ -200,6 +200,7 @@ impl<'d, T: Instance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> { unborrow!(_inner, rx, tx, tx_dma, rx_dma); T::enable(); + T::reset(); let pclk_freq = T::frequency(); // TODO: better calculation, including error checking and OVER8 if possible.