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.
This commit is contained in:
Koen Zandberg 2019-09-06 10:00:32 +02:00
parent dbd97b7588
commit a5c594ae5f
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -269,6 +269,9 @@ void usbdev_init_lowlevel(void)
static void _init(usbdev_t *dev) static void _init(usbdev_t *dev)
{ {
DEBUG("nrfusb: initializing\n"); 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; nrfusb_t *usbdev = (nrfusb_t*)dev;
poweron(usbdev); poweron(usbdev);
usbdev->used = 0; usbdev->used = 0;