WDT — Watchdog timer

The countdown watchdog timer (WDT) uses the low-frequency clock source (LFCLK) and offers configurable and robust protection against application lock-up.

The main features of WDT are:

WDT must be configured before it is started. After configuration, WDT is started by triggering the START task.

When WDT is running, its configuration registers (CRV, RREN, and CONFIG) are blocked for further configuration.

WDT can be paused while the CPU is sleeping, or when the debugger has halted the CPU. WDT is implemented as a down-counter that generates a TIMEOUT event when it wraps over after counting down to 0. When WDT is started by the START task, the watchdog counter is loaded with the value specified in the CRV register. This counter is also reloaded with the value specified in the CRV register when a reload request is granted.

The timeout period for the watchdog is given by the following equation:


      timeout [s] = ( CRV + 1 ) / 32768
    

When started, WDT will make the 32.768 kHz RC oscillator start if no other 32.768 kHz clock source is running and generating the 32.768 kHz system clock, see chapter CLOCK — Clock control.

Reload criteria

WDT has eight separate reload request registers. These registers are used to request WDT to reload its counter with the value specified in the CRV register. To reload the watchdog counter, write 0x6E524635 to all enabled reload registers.

One or more RR registers can be individually enabled through the RREN register.

Temporarily pausing the watchdog

By default, the watchdog will be active counting down the down-counter while the CPU is sleeping. It is possible to configure the watchdog to automatically pause when the CPU is sleeping or when it is stopped by the debugger.

Entering System OFF mode will stop and disable the watchdog.

Watchdog reset

A TIMEOUT event automatically leads to a watchdog reset.

If the watchdog is configured to generate an interrupt on the TIMEOUT event, the watchdog reset is postponed by two 32.768 kHz clock cycles after the TIMEOUT event is generated. Once the TIMEOUT event is generated, and unless the watchdog is stopped, the impending watchdog reset will occur.

The watchdog can be reset from several reset sources, see Reset behavior. After a reset, the watchdog configuration registers are available for configuration.

See RESET — Reset control for more information about reset sources.

The TIMEOUT event will also generate NMI interrupt, when NMI interrupt is supported. See the the instance's configuration in Instantiation to see if NMI is supported.

Stopping the watchdog

By default, the watchdog cannot be stopped. It is possible to configure the watchdog to allow the STOP task.

To stop the watchdog, perform the following steps.
  1. Set the CONFIG register's STOPEN field to Enable during watchdog configuration.
  2. Write the special value 0x6E524635 to the TSEN register.
  3. Invoke the STOP task.
When these conditions are met, the watchdog is stopped and a STOPPED event is issued.

When the watchdog is stopped, its configuration registers CRV, RREN, and CONFIG are no longer blocked.

Note: It is recommended to write zeros to TSEN after the watchdog has stopped, to avoid runaway code triggering the STOP task.

Registers

Instances

InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
WDT30GLOBAL0x50108000HFSNANo

Watchdog timer WDT30

WDT31 : S
WDT31 : NS

GLOBAL

0x50109000
0x40109000

USSNANo

Watchdog timer WDT31

Configuration

InstanceDomainConfiguration
WDT30GLOBAL

Supports non-maskable interrupts (NMI).

WDT31 : S
WDT31 : NS

GLOBAL

Does not generate non-maskable interrupts.

Register overview

RegisterOffsetTZDescription
TASKS_START0x000

Start WDT

TASKS_STOP0x004

Stop WDT

SUBSCRIBE_START0x080

Subscribe configuration for task START

SUBSCRIBE_STOP0x084

Subscribe configuration for task STOP

EVENTS_TIMEOUT0x100

Watchdog timeout

EVENTS_STOPPED0x104

Watchdog stopped

PUBLISH_TIMEOUT0x180

Publish configuration for event TIMEOUT

PUBLISH_STOPPED0x184

Publish configuration for event STOPPED

INTENSET0x304

Enable interrupt

INTENCLR0x308

Disable interrupt

NMIENSET0x324

Enable interrupt

NMIENCLR0x328

Disable interrupt

RUNSTATUS0x400

Run status

REQSTATUS0x404

Request status

CRV0x504

Counter reload value

RREN0x508

Enable register for reload request registers

CONFIG0x50C

Configuration register

TSEN0x520

Task stop enable

RR[n]0x600

Reload request n

TASKS_START

Address offset: 0x000

Start WDT

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

W

TASKS_START

Start WDT

Trigger

1

Trigger task

TASKS_STOP

Address offset: 0x004

Stop WDT

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

W

TASKS_STOP

Stop WDT

Trigger

1

Trigger task

SUBSCRIBE_START

Address offset: 0x080

Subscribe configuration for task START

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

CHIDX

[0..255]

DPPI channel that task START will subscribe to

B

RW

EN

Disabled

0

Disable subscription

Enabled

1

Enable subscription

SUBSCRIBE_STOP

Address offset: 0x084

Subscribe configuration for task STOP

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

CHIDX

[0..255]

DPPI channel that task STOP will subscribe to

B

RW

EN

Disabled

0

Disable subscription

Enabled

1

Enable subscription

EVENTS_TIMEOUT

Address offset: 0x100

Watchdog timeout

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

EVENTS_TIMEOUT

Watchdog timeout

NotGenerated

0

Event not generated

Generated

1

Event generated

EVENTS_STOPPED

Address offset: 0x104

Watchdog stopped

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

EVENTS_STOPPED

Watchdog stopped

NotGenerated

0

Event not generated

Generated

1

Event generated

PUBLISH_TIMEOUT

Address offset: 0x180

Publish configuration for event TIMEOUT

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

CHIDX

[0..255]

DPPI channel that event TIMEOUT will publish to

B

RW

EN

Disabled

0

Disable publishing

Enabled

1

Enable publishing

PUBLISH_STOPPED

Address offset: 0x184

Publish configuration for event STOPPED

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW

CHIDX

[0..255]

DPPI channel that event STOPPED will publish to

B

RW

EN

Disabled

0

Disable publishing

Enabled

1

Enable publishing

INTENSET

Address offset: 0x304

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW
W1S

TIMEOUT

Write '1' to enable interrupt for event TIMEOUT

Set

1

Enable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

B

RW
W1S

STOPPED

Write '1' to enable interrupt for event STOPPED

Set

1

Enable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

INTENCLR

Address offset: 0x308

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW
W1C

TIMEOUT

Write '1' to disable interrupt for event TIMEOUT

Clear

1

Disable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

B

RW
W1C

STOPPED

Write '1' to disable interrupt for event STOPPED

Clear

1

Disable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

NMIENSET

Address offset: 0x324

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW
W1S

TIMEOUT

Write '1' to enable interrupt for event TIMEOUT

Set

1

Enable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

B

RW
W1S

STOPPED

Write '1' to enable interrupt for event STOPPED

Set

1

Enable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

NMIENCLR

Address offset: 0x328

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

RW
W1C

TIMEOUT

Write '1' to disable interrupt for event TIMEOUT

Clear

1

Disable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

B

RW
W1C

STOPPED

Write '1' to disable interrupt for event STOPPED

Clear

1

Disable

Disabled

0

Read: Disabled

Enabled

1

Read: Enabled

RUNSTATUS

Address offset: 0x400

Run status

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

R

RUNSTATUSWDT

Indicates whether or not WDT is running

NotRunning

0

Watchdog is not running

Running

1

Watchdog is running

REQSTATUS

Address offset: 0x404

Request status

Bit number313029282726252423222120191817161514131211109876543210
IDHGFEDCBA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
A-H

R

RR[i] (i=0..7)

Request status for RR[i] register

DisabledOrRequested

0

RR[i] register is not enabled, or are already requesting reload

EnabledAndUnrequested

1

RR[i] register is enabled, and are not yet requesting reload

CRV

Address offset: 0x504

Counter reload value

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
A

RW

CRV

[0xF..0xFFFFFFFF]

Counter reload value in number of cycles of the 32.768 kHz clock

RREN

Address offset: 0x508

Enable register for reload request registers

Bit number313029282726252423222120191817161514131211109876543210
IDHGFEDCBA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
A-H

RW

RR[i] (i=0..7)

Enable or disable RR[i] register

Disabled

0

Disable RR[i] register

Enabled

1

Enable RR[i] register

CONFIG

Address offset: 0x50C

Configuration register

Bit number313029282726252423222120191817161514131211109876543210
IDCBA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
A

RW

SLEEP

Configure WDT to either be paused, or kept running, while the CPU is sleeping

Note: This feature will not affect power consumed by the WDT.

Pause

0

Pause WDT while the CPU is sleeping

Run

1

Keep WDT running while the CPU is sleeping

B

RW

HALT

Configure WDT to either be paused, or kept running, while the CPU is halted by the debugger

Pause

0

Pause WDT while the CPU is halted by the debugger

Run

1

Keep WDT running while the CPU is halted by the debugger

C

RW

STOPEN

Allow stopping WDT

Disable

0

Do not allow stopping WDT

Enable

1

Allow stopping WDT

TSEN

Address offset: 0x520

Task stop enable

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

W

TSEN

Allow stopping WDT

Enable

0x6E524635

Value to allow stopping WDT

RR[n]

Address offset: 0x600 + (n × 0x4)

Reload request n

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A

W

RR

Reload request register

Reload

0x6E524635

Value to request a reload of the watchdog timer