diff --git a/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pwr.c b/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pwr.c index e699fd9fff..93f927bc37 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pwr.c +++ b/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pwr.c @@ -391,7 +391,10 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry) if(SLEEPEntry == PWR_SLEEPENTRY_WFI) { /* Request Wait For Interrupt */ - __NOP(); + __WFI(); + __NOP(); // Workaround for STM32F4 errata + __NOP(); // see chapter 2.1.3 - Debugging Sleep/Stop mode with WFE/WFI entry + __NOP(); // https://www.st.com/resource/en/errata_sheet/dm00037591-stm32f405-407xx-and-stm32f415-417xx-device-limitations-stmicroelectronics.pdf } else {