Hard fault when using WFE in vApplicationIdleHook()

I am using stm32l162ve with FreeRTOS 7.1.0. System execute the following code in vApplicationIdleHook(). asm volatile( “dsb” ); asm volatile( “wfi” ); asm volatile( “isb” ); If the system clock run at 16MHz, everything is fine. If I change the system clock to 32Mhz, system gets hard fault after executing vApplicationIdleHook(). I have to remove the code in vApplicationIdleHook(). Have someone experienced the same problem before?

Hard fault when using WFE in vApplicationIdleHook()

(v7.1.0 is really, really old!) I have never experienced this behaviour. If you were using a newer version you could just set configUSETICKLESSIDLE to 1 rather than doing this yourself.