From 89191b00eae258642cd3d6458bc5440341bbc8d1 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 2 Dec 2024 08:18:28 +0100 Subject: [PATCH] stm32/main: Deinitialize SPI and I2C on soft-reset. Following UART, CAN, Timer, etc. Signed-off-by: iabdalkader --- ports/stm32/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/stm32/main.c b/ports/stm32/main.c index df483602dc90..ea870ef0da7c 100644 --- a/ports/stm32/main.c +++ b/ports/stm32/main.c @@ -678,6 +678,10 @@ void stm32_main(uint32_t reset_mode) { soft_timer_deinit(); timer_deinit(); uart_deinit_all(); + spi_deinit_all(); + #if MICROPY_PY_PYB_LEGACY && MICROPY_HW_ENABLE_HW_I2C + pyb_i2c_deinit_all(); + #endif #if MICROPY_HW_ENABLE_CAN can_deinit_all(); #endif