[riot-notifications] [RIOT-OS/RIOT] sam0: Implement watchdog driver (#11520)

benpicco notifications at github.com
Mon May 13 19:07:26 CEST 2019

### Contribution description
Most SoCs include a Watchdog timer peripheral that will trigger a reset if it is not regularly updated.

This can be used to automatically reset a board that is stuck in an error condition.

Many Watchdogs will provide a window mode: Feeding the Watchdog has to occur before `period` is elapsed, but after `window` is over.
This is to prevent a live-lock type situation where the Watchdog is updated earlier than usual.

A Watchdog may also trigger an Early Warning Interrupt shortly before the Watchdog Period is elapsed.

This PR implements the Watchdog interface for the sam0 line of SoCs.

### Testing procedure

Run `tests/periph_wdt`

Four tests should run during which the Watchdog will be fed five times, then a board reset should be triggered.

### Issues/PRs references
Tested on:
- [x] samd21
- [ ] saml11
- [ ] saml21
- [x] samd5x

On samd5x the Watchdog is always clocked by OSCULP32K, no further configuration is needed / possible. The same might be true for SAML11 & SAML21.

There are still some issues, but I suppose it's good to get feedback early on.

- [x] Normal mode
- [ ] Window mode - reset occurs too early
- [ ] Early Warning mode - only one Interrupt is generated
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * drivers/periph_common: add Watchdog driver header
  * sam0_common: add Watchdog implementation
  * tests: add test for the Watchdog peripheral

-- File Changes --

    M cpu/sam0_common/Makefile.features (1)
    A cpu/sam0_common/periph/wdt.c (212)
    A drivers/include/periph/wdt.h (76)
    M drivers/periph_common/init.c (7)
    A tests/periph_wdt/Makefile (8)
    A tests/periph_wdt/README.md (8)
    A tests/periph_wdt/main.c (136)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190513/848bf78f/attachment.html>

More information about the notifications mailing list