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 CDCACM can send and recevie in interrupt routine #13713

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

yangsong8-ai
Copy link
Contributor

@yangsong8-ai yangsong8-ai commented Sep 29, 2024

Summary

  1. Delete CDCACM redundant code and shares apis in the serial port.
  2. The existing cdcacm does not support sending and receiving data in interrupt, by adding void (*poll)(FAR struct usbdev_ep_s *ep) to the usb interface to support sending and receiving data in polling mode in interrupt, while changing the normal sending and receiving to use dma interface.
  3. Because the data sent and received is multi-byte, the corresponding APIs in serial is modified synchronously.

Impact

Two APIs, named uart_recvbuf and uart_sendbuf, are added to the struct uart_ops_s.
One API, named poll, is added to the struct usbdev_epops_s .
CDCACM uses the dma interface in struct uart_ops_s for sending and receiving.
In interrupt, CDCACM sends data by using cdcuart_txready, cdcuart_sendbuf, cdcuart_txempty.
In interrupt, CDCACM receives data by using cdcuart_rxavailable, cdcuart_recvbuf.

Testing

Test normal serial and cdcacm sending and receiving
After the crash, in interrupt routine, use gdbstub to test the sending and receiving of cdcacm and serial.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
@github-actions github-actions bot added Area: USB Size: L The size of the change in this PR is large labels Sep 29, 2024
@nuttxpr
Copy link

nuttxpr commented Sep 29, 2024

[Experimental Bot, please feedback here]

I need the content of the actual PR to assess if it meets the NuttX requirements. Please provide the following:

  • Link to the PR: This will allow me to see the proposed changes, commit messages, and any discussion within the PR.
  • Description of the changes: A brief overview of what the PR aims to achieve.

With this information, I can effectively determine if the PR meets the NuttX requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: USB Size: L The size of the change in this PR is large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants