Skip to content

Commit dba734f

Browse files
authored
Merge pull request #15446 from mak22223/master
Add fix for STM32G4 hardfault in sleep mode
2 parents 3c1f0d5 + 5558225 commit dba734f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/STM32G4xx_HAL_Driver/stm32g4xx_hal_pwr.c

+3
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
473473
{
474474
/* Request Wait For Interrupt */
475475
__WFI();
476+
__ISB(); // Workaround for STM32G4 errata
477+
// see chapter 2.2.8 - Wrong instruction fetches from flash memory upon wakeup from Sleep or Stop mode when debug in low-power mode is enabled
478+
// https://www.st.com/resource/en/errata_sheet/es0430-stm32g471xx473xx474xx483xx484xx-device-errata-stmicroelectronics.pdf
476479
}
477480
else
478481
{

0 commit comments

Comments
 (0)