nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

usbhost: cdcacm exit wq after copy all received data

Open yangsong8-a1 opened this issue 2 weeks ago • 6 comments

Summary

cdcacm exit wq after copy all received data

Impact

Fix issue: When the SIM CDCACM host receives data, the second packet data reception is incorrect.

Testing

  1. Compile usbhost: ./build.sh sim:usbhost -j8
  2. Start usbhost: sudo nuttx/nuttx
  3. Compile usbdev: ./build.sh sim:usbdev -j8
  4. Start usbdev: sudo nuttx/nuttx
  5. Enable usbdev as cdcacm: input conn 1
  6. In usbhost, input cat /dev/ttyACM0 &
  7. In usbdev, input echo hello > /dev/ttyACM0 multiple times. Note that the second hello does not display correctly in usbhost.

yangsong8-a1 avatar Dec 09 '25 09:12 yangsong8-a1

@yangsong8-a1 this testing you did is really cool:

Compile usbhost: ./build.sh sim:usbhost -j8
Start usbhost: sudo nuttx/nuttx
Compile usbdev: ./build.sh sim:usbdev -j8
Start usbdev: sudo nuttx/nuttx
Enable usbdev as cdcacm: input conn 1
In usbhost, input cat /dev/ttyACM0 &
In usbdev, input echo hello > /dev/ttyACM0 multiple times.
Note that the second hello does not display correctly in usbhost.

Please include it at usbhost board profile: https://nuttx.apache.org/docs/latest/platforms/sim/sim/boards/sim/index.html

There is missing the clear steps like you did here and the usbdev example there is very complex.

@acassis I've added it. Please check if it's appropriate. Thank you.

yangsong8-a1 avatar Dec 09 '25 16:12 yangsong8-a1

@yangsong8-a1 this testing you did is really cool:

Compile usbhost: ./build.sh sim:usbhost -j8
Start usbhost: sudo nuttx/nuttx
Compile usbdev: ./build.sh sim:usbdev -j8
Start usbdev: sudo nuttx/nuttx
Enable usbdev as cdcacm: input conn 1
In usbhost, input cat /dev/ttyACM0 &
In usbdev, input echo hello > /dev/ttyACM0 multiple times.
Note that the second hello does not display correctly in usbhost.

Please include it at usbhost board profile: https://nuttx.apache.org/docs/latest/platforms/sim/sim/boards/sim/index.html There is missing the clear steps like you did here and the usbdev example there is very complex.

@acassis I've added it. Please check if it's appropriate. Thank you.

Very nice! I improved it a little bit to make it easier to understand by someone new to NuttX

acassis avatar Dec 09 '25 17:12 acassis

@simbit18 how to add "ans" do the .codespellrc ? It is failing this PR because the SIM Documentation has "ans init"

acassis avatar Dec 09 '25 17:12 acassis

Hi @acassis, if I'm not mistaken, the line should be added to this file https://github.com/apache/nuttx/blob/master/.codespell-ignore-lines

simbit18 avatar Dec 09 '25 18:12 simbit18

Hi @acassis, if I'm not mistaken, the line should be added to this file https://github.com/apache/nuttx/blob/master/.codespell-ignore-lines

Thank you @simbit18

acassis avatar Dec 09 '25 18:12 acassis

Hi @acassis, if I'm not mistaken, the line should be added to this file https://github.com/apache/nuttx/blob/master/.codespell-ignore-lines

Thank you @simbit18

@acassis

xiaoxiang781216 avatar Dec 13 '25 05:12 xiaoxiang781216