I have been trying for a while to resolve this but I think I need some help.
I cannot get the ARM to wake up properly after executing a WFI instruction when caching is on. The system wakes up, but immediately has an exception (not sure which one). It seems to work as expected with caching turned off.
I assume that I need to do some cache maintenance, but I am not sure exactly what to do. I have tried Clean/Invalidate/Flush before the WFI instruction and various combinations of cache enable/disable with no luck. I am using the ccm_enter_low_power() Baremetal BSP function from Freescale and I have looked at how Linux does the WFI instruction but I am still missing something.
Is there an app note or section of the RM that anyone can point me to that explains the Cache relationship with WFI? Or other WFI gotchas that might apply?