This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new a87ad983432 usbhost: cdcacm exit wq after copy all received data
a87ad983432 is described below
commit a87ad9834323b8acb58a0560244e4574adb0c208
Author: yangsong8 <[email protected]>
AuthorDate: Mon Feb 17 11:20:52 2025 +0800
usbhost: cdcacm exit wq after copy all received data
Fix issue: When the SIM CDCACM host receives data, the second packet
data reception is incorrect.
Signed-off-by: yangsong8 <[email protected]>
---
.codespell-ignore-lines | 2 +-
.../platforms/sim/sim/boards/sim/index.rst | 37 ++++++++++++++++++++++
drivers/usbhost/usbhost_cdcacm.c | 1 +
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/.codespell-ignore-lines b/.codespell-ignore-lines
index 759acb298d7..b714260b420 100644
--- a/.codespell-ignore-lines
+++ b/.codespell-ignore-lines
@@ -17,7 +17,7 @@ Linix 45ZWN24-40 2 0.5 Ohm 0.400 mH 2.34A 24V
* [#15520](https://github.com/apache/nuttx/pull/15520) drivers/note: fix typo
falgs and align local name to irq_mask
* [#4526](https://github.com/apache/nuttx/pull/4526) Rearch video
* [#6447](https://github.com/apache/nuttx/pull/6447) bcm43xxx: Remove
bcmf_txavail_work and resue bcmf_tx_poll_work
- ans init
+ ans init
* CAF : Depends on CONFIG_NET_PROMISCUOUS
* been lost). If ORE is set along with RXNE then it tells you
/* GIR bits must be masked! */
diff --git a/Documentation/platforms/sim/sim/boards/sim/index.rst
b/Documentation/platforms/sim/sim/boards/sim/index.rst
index 1e28c5cc674..e35a0e0582d 100644
--- a/Documentation/platforms/sim/sim/boards/sim/index.rst
+++ b/Documentation/platforms/sim/sim/boards/sim/index.rst
@@ -1859,6 +1859,43 @@ This is a configuration with sim usbhost support.
Run sim usbhost with root mode, run sim usbdev or plug-in cdcacm usb device.
Then you can use ``/dev/ttyACM`` to transfer data.
+ Here we will demonstrate an example of interaction between sim usbhost and
+ sim usbdev. Build two executable files using the configurations
``sim:usbdev``
+ and ``sim:usbhost`` respectively.
+
+ Run each executable files as root in different terminals.
+ Terminal 1 (run nuttx binary from sim:usbhost):
+
+ .. code:: console
+
+ $ sudo ./nuttx
+
+ Terminal 2 (run nuttx binary from sim:usbdev):
+
+ .. code:: console
+
+ $ sudo ./nuttx
+
+ Then, run CDCACM in usbdev.
+
+ .. code:: console
+
+ nsh> conn 1
+
+ Enter commands to read CDCACM on the usbhost:
+
+ .. code:: console
+
+ nsh> cat /dev/ttyACM0 &
+
+ Enter commands to write CDCACM on the usbdev:
+
+ .. code:: console
+
+ nsh> echo hello > /dev/ttyACM0
+
+ You can see the data on the usbhost: ``hello``.
+
login
-----
diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c
index 90c6ef539a3..4df3206a299 100644
--- a/drivers/usbhost/usbhost_cdcacm.c
+++ b/drivers/usbhost/usbhost_cdcacm.c
@@ -1175,6 +1175,7 @@ static void usbhost_rxdata_work(FAR void *arg)
uart_datareceived(uartdev);
nxfrd = 0;
+ break;
}
}