I have implemented the steps to stop all drivers and threads, then chSysDisable (like in http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:stop_os). But still whenever I call __WFI() (or __WFI() ) my code doesn't stop - neither in debug nor in release.
This is the last part of my code:
Code: Select all
PWR->CSR |= PWR_CSR_EWUP;
/* Clear Wake-up flag */
PWR->CR |= PWR_CR_CWUF;
/* Select STANDBY mode */
PWR->CR |= PWR_CR_PDDS;
/* Set SLEEPDEEP bit of Cortex System Control Register */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__DSB();
/* Request Wait For Interrupt */
__WFI();
__WFE();
But the CPU doesn't stop at the WFI (or WFE) instructions ...
In the context of all this, could somebody recommend how to "stop" the CPU effectively?