Skip to content

Commit 82fc228

Browse files
authored
Merge pull request #12717 from 0xc0170/fix_sleep_stm32f4
Add fix for STM32F4 hardfault in sleep mode
2 parents 9929ddd + b21aeaf commit 82fc228

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_pwr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
392392
{
393393
/* Request Wait For Interrupt */
394394
__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)