1. Overview

STR(short for Suspend to RAM) means that the device enters a low-power state and only retains RAM for self-refresh. All equipment and system states are stored in RAM, and peripherals are suspended.

2. Enable STR

Suspend APP:

Execute system("echo mem> /sys/power/state"); Suspend APP.

Before execution, exit all MI modules and pull down the gpio associated with the module, such as de-initializing disp/panel, uninstalling wifi ko, turning off the panel backlight, etc.

After the MI module has a new API, call the corresponding DeInitDev interface when the module exits and needs to release resources. For example, call MI_DISP_DeInitDev() when exiting the DISP module.

MI_S32 SSTAR_DestroyVdec2DispPipe(MI_S32 s32VdecChn, MI_S32 s32DivpChn)
    SSTAR_ModuleUnBind(E_MI_MODULE_ID_VDEC, 0, s32VdecChn, 0,
                    E_MI_MODULE_ID_DISP, 0, 0, 0); //DIVP->DISP
    MI_DISP_DisableInputPort(0, 0);


    return MI_SUCCESS;

3. Recovery APP

Wake up the APP through an external interrupt, then turn on the panel backlight, load wifi, reinitialize the Panel and disp.

Set external interrupt:

The specified GPIO set in public board infinity2m.dtsi can recover APP, which can be set to other GPIO specified by the user or the interrupt pin corresponding to the touch screen.

APP demo can refer to UuidSSDPlayer/stdc++/zk_full_str.