HAL_PWR_EnterSLEEPMode() needs to have a __DSB() before the __WFI() or __WFE() according to ARM documentation
According to ARM Cortex-A Series Programmer’s Guide for ARMv8-A:15.1.2. Standby...This mode is entered using either the WFI (Wait For Interrupt) or WFE (Wait For Event) instructions. ARM recommends the use of a Data Synchronization Barrier (DSB) ins...