-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
usb: add new (experimental) USB device support #38679
usb: add new (experimental) USB device support #38679
Conversation
cf31ee6
to
e5707c9
Compare
e5707c9
to
81d6bc0
Compare
81d6bc0
to
fe97d9e
Compare
struct cdc_acm_uart_data *data = dev->data; | ||
|
||
atomic_set_bit(&data->state, CDC_ACM_CLASS_ENABLED); | ||
LOG_WRN("Configuration enabled"); |
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.
This definitely should be lower level than LOG_WRN
. Changing this to LOG_INF
would make it match the log level for configuration disabled message.
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.
Yes, have forgotten it again...
29a4a40
to
d8e636e
Compare
drivers/usb/udc/udc_nrf.c
Outdated
@@ -140,6 +161,7 @@ static void udc_event_xfer_in(const struct device *dev, | |||
buf = udc_buf_get(dev, ep, true); | |||
if (buf == NULL) { | |||
LOG_ERR("ep 0x%02x queue is empty", ep); | |||
__ASSERT(false, "ep 0x%02x queue is empty", ep); |
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.
Asserting on false is not that useful. It would be better to make it __ASSERT(buf != NULL, "ep 0x%02x queue is empty", ep);
. Also I think it would be better to place assert before if (buf == NULL)
|
||
if (!check_wq_ctx(dev)) { | ||
LOG_WRN("Invoked by inappropriate context"); | ||
__ASSERT(true, "Invoked by inappropriate context"); |
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.
Asserting on true makes no sense. Condition true
is always true and therefore always is fulfilled.
The assert should be __ASSERT(check_wq_ctx(dev), "Invoked by inappropriate context");
and be placed before the if statement.
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.
No, it should be __ASSERT(false, "Invoked by inappropriate context");
, alternative is __ASSERT_NO_MSG.
Add new USB device controller API and nRF USBD controller driver. The new UDC API brings support for multiple instances and asynchronous transfer model, transfers use net_buf and store methadata in the user data area. Signed-off-by: Johann Fischer <[email protected]>
Implement method to distiguish hal driver and UDC shim driver events. Signed-off-by: Johann Fischer <[email protected]>
HAL events were also used for the shim driver's concerns during the prototyping of API. Fix it now and use specific shim driver events. That also allows new transfers to be triggered from a single point. Signed-off-by: Johann Fischer <[email protected]>
Expand ifdef by adding new Kconfig option UDC_KINETIS as preparation for USBFSOTG UDC driver. Signed-off-by: Johann Fischer <[email protected]>
Add USBFSOTG UDC driver for Kinetis SoCs. Signed-off-by: Johann Fischer <[email protected]>
Simple test for API rules, allocation, queue, and dequeu of the endpoint requests. USB device controller should not be connected to the host as this state is not covered by this test. Signed-off-by: Johann Fischer <[email protected]>
The device supprt brings support for multiple stack instances, multiple configuration, asynchronous transfer model, ability to change most of the properties of a device at runtime and the composition of configuration and classes at runtime. The stack requires new UDC driver API and is not compatible with old driver API (usb_dc_). The classes (functions) of old (current) USB device stack cannot be used with new ones and must be ported. Signed-off-by: Johann Fischer <[email protected]>
Add UDC driver API reference. Signed-off-by: Johann Fischer <[email protected]>
The sample enables new experimental USB device support and the shell function. Signed-off-by: Johann Fischer <[email protected]>
Add experimental CDC ACM implementation for new USB device stack. It currently implements only UART IRQ API support and is WIP. Signed-off-by: Johann Fischer <[email protected]>
Add code and configuration to enable new USB device support. Signed-off-by: Johann Fischer <[email protected]>
Add code and configuration to enable new USB device support. Signed-off-by: Johann Fischer <[email protected]>
d8e636e
to
a5cb32c
Compare
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.
Time to merge this, despite some yet unresolved issues. This is experimental after all and will stay experimental for a while.
Add new USB device controller API (UDC API)
Add new USB device controller API and nRF USBD controller driver.
Add new USB device stack implementation using new UDC API
Resolves #19713
Resolves #29132
Resolves #29133
Resolves #29134
Resolves #29135
Resolves #29136
Resolves #30042
Commits introducing USB host controller (UHC) driver API are here for reasons and will be moved to own PR later.