[riot-notifications] [RIOT-OS/RIOT] cpu/nrf5x: implement wdt peripheral driver (#11556)

Alexandre Abadie notifications at github.com
Tue May 21 08:20:13 CEST 2019

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description

This PR implement the watchdog peripheral interface as proposed in #11527 on nRF5x CPU.

It has been tested with success on nrf52832-mdk, nrf52840-mdk and microbit.

On nrf, it's not possible to stop the watchdog once it's started so when setting up a timeout callback, the CPU is reset in all the case after 2 cycles of 32768kHz clock. This is quite fast and doesn't allow complex task to happen before reset: so I'm wondering if it's relevant to provide `periph_wdt_cb` on this platform.

Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

### Testing procedure

I used the following sample application to test the feature but it'll be more useful to test with the test application provided in #11252:
- main.c
#include <stdio.h>

#include "xtimer.h"
#include "periph/wdt.h"

int main(void)
    puts("Setup watchdog");
    wdt_setup_reboot(0, 2000);

    uint8_t cnt = 5;
    printf("%d\n", cnt);
    while (cnt--) {
        printf("%d\n", cnt);


    return 0;
- Makefile:
APPLICATION = wdt-sample
BOARD ?= nrf52830-mdk

USEMODULE += xtimer

include $(RIOTBASE)/Makefile.include

Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output

### Issues/PRs references

Based on #11527 

Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * drivers/include: add header definition for wdt
  * fixup! drivers/include: add header definition for wdt
  * cpu/nrf5x_common: implement periph_wdt driver

-- File Changes --

    M cpu/nrf5x_common/Makefile.features (1)
    A cpu/nrf5x_common/periph/wdt.c (116)
    A drivers/include/periph/wdt.h (169)

-- 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/20190520/125617dd/attachment.html>

More information about the notifications mailing list