Merge pull request #15446 from mak22223/master

Add fix for STM32G4 hardfault in sleep mode
pull/15448/head
Martin Kojtal 2023-08-16 15:33:43 +01:00 committed by GitHub
commit dba734fb70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -473,6 +473,9 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
{
/* Request Wait For Interrupt */
__WFI();
__ISB(); // Workaround for STM32G4 errata
// 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
// https://www.st.com/resource/en/errata_sheet/es0430-stm32g471xx473xx474xx483xx484xx-device-errata-stmicroelectronics.pdf
}
else
{