[riot-notifications] [RIOT-OS/RIOT] drivers/mrf24j40: allow for basic self-test on init (#12221)

benpicco notifications at github.com
Fri Sep 13 15:55:34 CEST 2019

### Contribution description

During production it is often desirable for devices to perform some kind of basic self test to isolate defects.

For this it is necessary for the initialization not to hang if a component is faulty / not connected.

This moves an already existing self-check that was previously enabled as a debug option to an independent compile-time configurable.

It is necessary to call this in _init() before `mrf24j40_hardware_reset()` as the reset function uses `xtimer_usleep()` which will cause another thread to get scheduled.
If this thread (e.g. rpl or ipv6) then tries to access the netdev, RIOT will crash.
### Testing procedure
- On a board with no mrf24j40 connected, add `USEMODULE += mrf24j40` to the Makefile of `examples/gnrc_networking`.
- observe that RIOT hangs on init.
- now add `CFLAGS += -DMRF24J40_TEST_SPI_CONNECTION=1` to the Makefile.
- observe that an error gets reported and RIOT boots normally without a radio interface.

- on a board with properly connected mrf24j40 no change in behavior should be visible.

### Issues/PRs references
#12142 implemented this for at86rf2xx
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * drivers/mrf24j40: allow for basic self-test on init

-- File Changes --

    M drivers/include/mrf24j40.h (12)
    M drivers/mrf24j40/mrf24j40_internal.c (19)
    M drivers/mrf24j40/mrf24j40_netdev.c (31)

-- 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/20190913/c0a167f5/attachment.htm>

More information about the notifications mailing list