EM4 on the original Gecko MCU served as a kind of lowest power standby mode where the only wake-up options were power-cycling the device or asserting the RESETn pin. This was enhanced on subsequent devices with a mechanism that allows wake-up via alternate pins that, while still causing resets, are registered so that program flow can change depending on which pin caused the wake-up.
Pin-based wake-ups on Jade and Pearl Gecko, along with the EFR32 Blue, Flex, and Mighty Gecko families, operate in a fashion similar to that on previous devices. No distinction is made between hibernate (EM4H) and shutoff (EM4S) modes with regards to either configuration or functionality; pin wake-ups operate the same in both modes.
Knowing this, then, how are pin wake-ups configured on these devices? The procedure is quite simple:
Once setup is complete, including anything needed for EM4, such as selection of hibernate or shutoff mode, drop into EM4 at any time by calling the emlib EMU_EnterEM4() function or by writing the designated bit sequence to the EM4ENTRY field of the EMU_EM4CTRL register. Wake-up occurs when a designated pin (or pins) sees its specified level in addition to the usual RESETn assertion or power-cycling events.
To illustrate this, an example Simplicity Studio v4 project for the Pearl Gecko SLSTK3401A Starter Kit is attached to this Knowledge Base article. Program flow is as follows:
After downloading the example project, import it into Simplicity Studio as follows:
Build the project, download it to the STK, and run it with the debugger. Note that when the MCU enters EM4, the debugger will lose its connection to the STK. Press BTN1 to exit EM4 before attempting to restore the debugger connection.