4.4.2.1 Entering and Exiting Wait Mode
To enter Wait mode, follow the steps in the sequence below:
- Stop Subsystem 1, and stop its clock and assert core and peripheral resets.
- Apply the sequence for PMC configuration as defined in Ultra Low Power Modes and Fast Start-Up in the section Power Management Controller (PMC).
- In order to avoid power consumption with an external on-board device, depending on peripheral use in the application, all IOs must be set to a known state either externally or internally via input pull-up or pull-down, or via output low or high level, or to an inactive state. Set peripheral IOs used previously into GPIO mode such as XIN/XOUT, ADx if used
- Set the FWS bit in EEFC_FMR to 0.
- Program one or several wake-up sources and clear any pending wake-up sources.
- Select one of the following methods to enter Wait mode and complete the sequence:
- Set the WAITMODE bit to 1 in the PMC Main Oscillator register (CKGR_MOR). Ensure that no access to PMC registers is attempted immediately after accessing the WAITMODE bit.
- Use the WFE instruction:
- Set the LPM bit in PMC_FSMR.
- Write a 0 to the SLEEPDEEP bit of the Cortex-M4 processor.
- Execute the Wait-For-Event (WFE) instruction of the processor.
Whether the WAITMODE bit or the WFE instruction was used to enter Wait mode, the system exits Wait mode if one of the enabled wake-up events listed in the table Low-Power Mode Summary occurs.
After exiting Wait mode, the PIO controllers have the same configuration state as before entering Wait mode. The device is clocked back to the RC oscillator frequency which was used before entering Wait mode. The core starts fetching from Flash or SRAM at this frequency.
