Skip to content

Commit c5c2113

Browse files
authored
Merge pull request #12726 from artokin/stm32f4_sleep_solution
feature-wisun: Add fix for STM32F4 hardfault in sleep mode
2 parents aa375c4 + 1aa999e commit c5c2113

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pwr.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,10 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
391391
if(SLEEPEntry == PWR_SLEEPENTRY_WFI)
392392
{
393393
/* Request Wait For Interrupt */
394-
__NOP();
394+
__WFI();
395+
__NOP(); // Workaround for STM32F4 errata
396+
__NOP(); // see chapter 2.1.3 - Debugging Sleep/Stop mode with WFE/WFI entry
397+
__NOP(); // https://www.st.com/resource/en/errata_sheet/dm00037591-stm32f405-407xx-and-stm32f415-417xx-device-limitations-stmicroelectronics.pdf
395398
}
396399
else
397400
{

0 commit comments

Comments
 (0)