soc: arm: stm32f3 enable Debug Module during SLEEP mode
This patch allows successive reflashing operation on stm32f3
boards by Enabling the Debug Module during SLEEP mode.
This will especially makes reflahing and debugging possible
with pyocd runner on west commands.
#include <zephyr/device.h>
#include <zephyr/init.h>
+#include <stm32_ll_system.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
#include <zephyr/arch/arm/aarch32/nmi.h>
@@ -43,6 +44,9 @@ static int stm32f3_init(const struct device *arg)
/* At reset, system core clock is set to 8 MHz from HSI */
SystemCoreClock = 8000000;
+ /* Allow reflashing the board */
+ LL_DBGMCU_EnableDBGSleepMode();
+
return 0;
}
