Reset

Overview

Reset is used to restore the system to an initial state, which can be utilized for error recovery, system software reboot, and other functionalities.

Reset Types

The chip supports multiple reset types.

RTL8721Dx:

Reset Type

Description

Usage Method

CHIP_EN

Reset generated by chip enable

Refer to Chip Enable

POR

Reset generated at power-on

BOR

Reset generated by undervoltage

Refer to BOD

DSLP

Reset generated when entering deep sleep mode

Refer to Power management

System reset

Software reset provided by the system

Refer to Software Reset

Warm reset

Software reset provided by the CPU

-

IWDG reset

Reset generated by independent watchdog timeout

Refer to Watchdog

WDG reset

Reset generated by system watchdog timeout

Refer to Watchdog

Reset Domains

RTL8721Dx:

Scope

RTC

Backup registers, Retention RAM, Wake pin, Trap pin

Other peripherals

CHIP_EN

Y

Y

Y

POR

Y

Y

Y

BOR

N

N

Y

DSLP

N

N

Y

System reset

N

N

Y

IWDG reset

N

N

Y

WDG reset

N

N

Y

  • Y: Indicates that the corresponding module will be reset when the reset event occurs.

  • N: Indicates that the corresponding module will not be reset when the reset event occurs.

Note

  • Warm reset is configured at system startup to reset all CPUs instead of only the local CPU. Refer to the Peripheral_Reset() function in the Bootloader for the peripherals that are reset by warm reset.

Obtaining Boot Reason

User can obtain the boot reason using the BOOT_Reason() function. Refer to Boot Reason .

Preserving Pre-reset Information

User can store critical data in backup registers or Retention RAM located in the AON region to prevent data loss due to reset.

Note

The following reset types will still cause data loss in backup registers or Retention RAM:

  • CHIP_EN

  • POR

Backup Registers

Realtek provides 4 32-bit backup registers: BKUP_REG0(), BKUP_REG1(), BKUP_REG2(), and BKUP_REG3() for use. User can manipulate these registers using the provided APIs.

Note

The system may use certain bits in the backup registers. User should search the SDK to confirm if a specific bit is already in use before using it.

API

BKUP_Write

Item

Description

Function

Write a value to the corresponding backup register

Params

  • DwordIdx: The backup register to operate on (BKUP_REG0-3)

  • WriteVal: The value to be written

Return

None

BKUP_Read

Item

Description

Function

Read the value from the corresponding backup register

Params

  • DwordIdx: The backup register to operate on (BKUP_REG0-3)

Return

The value of the corresponding backup register

BKUP_Set

Item

Description

Function

Set specific bits in the corresponding backup register

Params

  • DwordIdx: The backup register to operate on (BKUP_REG0-3)

  • BitMask: The bits to be set

Return

None

BKUP_Clear

Item

Description

Function

Clear specific bits in the corresponding backup register

Params

  • DwordIdx: The backup register to operate on (BKUP_REG0-3)

  • BitMask: The bits to be cleared

Return

None

Retention RAM

RTL8721Dx:

User can use the RRAM_DEV variable to store data in Retention RAM. The structure definition of this variable is RRAM_TypeDef, located in sysreg_lsys.h. Its structure member RRAM_USER_RSVD can be freely used by users.

Note

It is recommended that users prioritize using backup registers and only use Retention RAM when dealing with larger data volumes.

Software Reset Trigger Methods

User can execute a system reset by calling the System_Reset() function or by issuing a command. The definition of the System_Reset() function is as follows:

Item

Description

Function

Trigger a system software reset

Params

None

Return

None

Alternatively, the following command can be issued to any CPU to trigger a system software reset:

AT+RST