Skip to content
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: device_next: align CDC ACM UART with Interrupt-driven UART API #75439

Merged

Conversation

jfischer-no
Copy link
Collaborator

@jfischer-no jfischer-no commented Jul 4, 2024

Align CDC ACM UART with Interrupt-driven UART API behavior description.
Use the same flags in uart_irq_rx_ready(), uart_irq_tx_ready(), and
uart_irq_is_pending(), which are updated after each uart_irq_update()
call. Allow TX FIFO to be filled if there is space.

Add CDC ACM virtual UART Interrupt-driven API documentation.

  • poll_in/poll_out needs also be aligned with legacy CDC ACM UART behavior
  • poll_in/poll_out documentation

Fixes #76642

@jfischer-no jfischer-no added area: USB Universal Serial Bus Experimental Experimental features not enabled by default labels Jul 4, 2024
@jfischer-no jfischer-no self-assigned this Jul 4, 2024
@jfischer-no jfischer-no marked this pull request as ready for review August 14, 2024 11:19
@tmon-nordic
Copy link
Contributor

Commit "usb: device_next: allow fifo_fill and poll_out be used simultaneously" in this PR fixes #76642

tmon-nordic
tmon-nordic previously approved these changes Sep 9, 2024
@tmon-nordic
Copy link
Contributor

There is conflict in doc/connectivity/usb/device_next/usb_device.rst that has to be fixed.

tmon-nordic
tmon-nordic previously approved these changes Oct 1, 2024
carlescufi
carlescufi previously approved these changes Oct 1, 2024
@aescolar
Copy link
Member

aescolar commented Oct 2, 2024

@jfischer-no rebase needed

Move "Built-in functions" section down and increase the heading.

Signed-off-by: Johann Fischer <[email protected]>
Align CDC ACM UART with Interrupt-driven UART API behavior description.
Use the same flags in uart_irq_rx_ready(), uart_irq_tx_ready(), and
uart_irq_is_pending(), which are updated after each uart_irq_update()
call. Allow TX FIFO to be filled if there is space.

Signed-off-by: Johann Fischer <[email protected]>
In general, it mirrors what is described in Interrupt-driven API
documentation, but here a little more explicitly and with a simplified
example, so that we can finally chisel it into the stone.

Signed-off-by: Johann Fischer <[email protected]>
Apply changes in commit c152e09
("usb: device: cdc_acm: block in uart_poll_out() routine")
to the new CDC ACM UART poll_out implementation.

Signed-off-by: Johann Fischer <[email protected]>
As it is still accepted practice, allow fifo_fill and poll_out to be
used simultaneously. The lock around fifo_fill was already in place.

Signed-off-by: Johann Fischer <[email protected]>
Add note about CDC ACM virtual UART polling API behavior.

Signed-off-by: Johann Fischer <[email protected]>
When the controller is connected to a full speed bus, regardless of
whether the controller supports high speed or not, the transfer size for
the bulk OUT endpoint should be equal to the MPS in the current
configuration.

Signed-off-by: Johann Fischer <[email protected]>
Use delayable work to reduce CPU load when there is no transfer flow in
the host direction. This also improves the performance of poll out, as
introduced in commit commit fed6bde
("usb: device: cdc_acm: send more than 1 byte in poll out")
for the legacy CDC ACM implementation.

Signed-off-by: Johann Fischer <[email protected]>
@fabiobaltieri fabiobaltieri merged commit fe4d8a6 into zephyrproject-rtos:main Oct 2, 2024
23 checks passed
@jfischer-no jfischer-no deleted the pr-doc-device-next-cdc-acm branch October 2, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus Experimental Experimental features not enabled by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling USB CDC ACM poll out in preemptible context can lead to endless loop
5 participants