GD32VF103 User Manual
52
Deep-sleep mode
The Deep-sleep mode is based on the SLEEPDEEP mode of the RISC-V. In Deep-sleep
mode, all clocks in the 1.2V domain are off, and all of IRC8M, HXTAL and PLLs are disabled.
The contents of SRAM and registers are preserved. The LDO can operate normally or in low
power mode depending on the LDOLP bit in the PMU_CTL register. Before entering the Deep-
sleep mode, it is necessary to set the CSR_SLEEPVALUE bit in the RISC-V System Control
Register, and clear the STBMOD bit in the PMU_CTL register. Then, the device enters the
Deep-sleep mode after a WFI or WFE instruction is executed. If the Deep-sleep mode is
entered by executing a WFI instruction, any interrupt from EXTI lines can wake up the system.
If it is entered by executing a WFE instruction, any wakeup event from EXTI lines can wake
up the system. When exiting the Deep-sleep mode, the IRC8M is selected as the system
clock. Notice that an additional wakeup delay will be incurred if the LDO operates in low power
mode.
Note:
In order to enter Deep-sleep mode smoothly, all EXTI line pending status (in the
EXTI_PD register) and RTC alarm/time stamp/tamper flag must be reset. If not, the program
will skip the entry process of Deep-sleep mode to continue to execute the following procedure.
The Standby mode is based on the SLEEPDEEP mode of the RISC-V, too. In Standby mode,
the whole 1.2V domain is power off, the LDO is shut down, and all of IRC8M, HXTAL and
PLLs are disabled. Before entering the Standby mode, it is necessary to set the
CSR_SLEEPVALUE bit in the RISC-V System Control Register, and set the STBMOD bit in
the PMU_CTL register, and clear WUF bit in the PMU_CS register. Then, the device enters
the Standby mode after a WFI or WFE instruction is executed, and the STBF status flag in
the PMU_CS register indicates that the MCU has been in Standby mode. There are four
wakeup sources for the Standby mode, including the external reset from NRST pin, the RTC
alarm/time stamp/tamper events, the FWDGT reset, and the rising edge on WKUP pin. The
Standby mode achieves the lowest power consumption, but spends longest time to wake up.
Besides, the contents of SRAM and registers in 1.2V power domain are lost in Standby mode.
When exiting from the Standby mode, a power-on reset occurs and the RISC-V will execute
instruction code from the 0x00000000 address.
Table 3-1. Power saving mode summary
Mode
Sleep
Deep-sleep
Standby
Description
Only CPU clock is off
All clocks in the 1.2V
domain are off
Disable IRC8M, HXTAL and
PLL
The 1.2V domain is power
off
Disable IRC8M, HXTAL
and PLL
LDO Status
On
On or in low power mode
Off
Configuration
CSR_SLEEPVALUE =
0
CSR_SLEEPVALUE = 1
STBMOD = 0
CSR_SLEEPVALUE = 1
STBMOD = 1, WURST=1
Entry
WFI or WFE
WFI or WFE
WFI or WFE