From a5c594ae5feabdbfcfa50719e34fc6af4ccb140e Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Fri, 6 Sep 2019 10:00:32 +0200 Subject: [PATCH] nrfusb: Check chip revision before enabling Engineering sample A doesn't have a functional USB peripheral (errata issue 94). This commit adds an assertion check for this revision to prevent some developer headaches. --- cpu/nrf52/periph/usbdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpu/nrf52/periph/usbdev.c b/cpu/nrf52/periph/usbdev.c index c8a588653a..6b6a1c3916 100644 --- a/cpu/nrf52/periph/usbdev.c +++ b/cpu/nrf52/periph/usbdev.c @@ -269,6 +269,9 @@ void usbdev_init_lowlevel(void) static void _init(usbdev_t *dev) { DEBUG("nrfusb: initializing\n"); + /* Engineering revision version A is affected by errata 94, crash * + * instead of pretending to have functional USB */ + assert(NRF_FICR->INFO.VARIANT != 0x41414141); nrfusb_t *usbdev = (nrfusb_t*)dev; poweron(usbdev); usbdev->used = 0;