4.1.4.5 General Purpose IO (GPIO) State in Backup Mode

If the VDD3V3 power supply shown in the figures above is maintained before entering Backup mode, the state of any PIO line can be defined as input (pull-up or pull-down) or output (low or high level). All PIO lines can therefore be configured to a stable and known state in order to avoid any extra power consumption or any current path with the input/output lines of the external on-board devices. Configuration of the GPIO lines is maintained in the same state as before entering Backup mode.

By default, when waking up from Backup mode, all PIO lines are reset to their default state. In some cases, it may be necessary to postpone resetting some PIO lines until the main application program has reached a certain point. In these cases, IO retention can be configured in the IO Retention register. The granularity of the configuration is 8. Refer to the IO Retention register in the section Special Function Registers (SFR) for further details. Only removal of VBAT and VDD3V3 will reset the IO Retention configuration to the default mode.