-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nrf52: Add USB peripheral driver #11074
Conversation
c298d3e
to
b28745d
Compare
Needs rebase, I believe ;-) |
Also needs a bit of work, I've neglected so far to rework this driver to the current periph_usbdev architecture. |
BTW, I have a nrf52dk so I should be able to help here :) |
rebased and updated! |
Ready for review here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick first round, only nitpicks.
Is there any restriction with nRF52832 devices ?? I see a bunch of reference to nRF52840 but does it work on nRF52832 ??
cpu/nrf52/include/nrfusb.h
Outdated
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif /* SAM_USB_H */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not SAM anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, 😢
fixed
cpu/nrf52/periph/usbdev.c
Outdated
*/ | ||
|
||
/** | ||
* @ingroup sam0_common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sam0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
*/ | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <errno.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any errno, maybe this can be removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required for the -ENOTSUP
return values
As far as I know, the nRF52832 doesn't have the USB peripheral, only the nRF52840 has one. |
I checked the datasheet of both and this is indeed the case. nrf51 also doesn't provide an USB peripheral. |
I can test on nrf52840-dk/mdk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on nrf52840-mdk, nrf52840-dk and it works like a charm.
Codewise I'm fine with the changes. Please squash.
ACK
Squashed and rebased. @aabadie I took the liberty of fixing the alphabetical order of the |
And fixed two typo's in two commit messages |
Contribution description
This PR adds a USB peripheral driver for the nrf52840 MCU.
Makefile configuration is supplied for the nrf52840dk and the nrf52840-mdk. Feel free to suggest more boards if I missed some.
Testing procedure
WARNING: due to errata 104 and errata 180, this driver won't work for the engineering sample A chips. From engineering sample B and newer it should be fine.
Issues/PRs references
depends on #9830, requires #10916 for actual testing