Page 2 of 3
Re: USB CDC ACM and 64 bytes transaction
Posted: Sun Oct 27, 2024 6:26 pm
by russian
Thank you for looking into this!
Re: USB CDC ACM and 64 bytes transaction
Posted: Mon Oct 28, 2024 10:33 pm
by Dron_Gus
Giovanni wrote:Hi,
Could you post your changes?
Hi.
Sorry for late reply.
Attached. Did not have time to clean-up it.
With this set of patches I see no delays with 64 bytes OUT transaction. As soon as I do dd to ACM in one terminal I see "received 64" in minicom (I'm using SD for debug messages).
But 64, 128 .. bytes transaction is still marked timeout in sniffer. 63 and 65 bytes transactions are not.
Re: USB CDC ACM and 64 bytes transaction
Posted: Tue Oct 29, 2024 8:16 am
by Giovanni
Hi,
Is that an USB analyzer that you use for those logs or some kind of SW?
Giovanni
Re: USB CDC ACM and 64 bytes transaction
Posted: Tue Oct 29, 2024 10:47 am
by Dron_Gus
Giovanni wrote:Hi,
Is that an USB analyzer that you use for those logs or some kind of SW?
Giovanni
Hi
I rented a TotalPhase Beagle 480
https://www.totalphase.com/products/beagle-usb480/ .
Initial bug hunting was done with WireShark under Linux.
Re: USB CDC ACM and 64 bytes transaction
Posted: Wed Oct 30, 2024 1:16 am
by FXCoder
FYI from Great Scott...
cynthionIn addition to the list of suppliers...
Mouser
Re: USB CDC ACM and 64 bytes transaction
Posted: Wed Oct 30, 2024 5:04 am
by Giovanni
Hi,
Thanks Bob, I was just searching for something like this, usually analyzers are not that cheap.
Giovanni
Re: USB CDC ACM and 64 bytes transaction
Posted: Mon Nov 04, 2024 10:32 am
by Dron_Gus
Seems we found a workaround for our case:
https://github.com/rusefi/ChibiOS/pull/48 .
At least I do not see any communication freeze any more. 64-bytes writes are still marked red/timeout, but this does not affect anything (I hope)
Re: USB CDC ACM and 64 bytes transaction
Posted: Mon Nov 04, 2024 1:45 pm
by Giovanni
Thanks for confirming, will give it a try ASAP.
Giovanni
Re: USB CDC ACM and 64 bytes transaction
Posted: Wed Nov 13, 2024 11:28 am
by Giovanni
Hi,
What I am seeing using the USB_RAW demo on an STM32F746:
Reading data from the demo always works using:
Code: Select all
dd if=/dev/ttyACM1 of=/dev/null bs=512 count=1000
It works regardless of the count and block size.
Writing data to the demo only works for packets up to 64 bytes, anything bigger fails and DD is stuck.....
Code: Select all
dd if=/dev/zero of=/dev/ttyACM1 bs=64 count=1000
So far I have not an explanation for this, adding the retry to the ISR does not help.
Giovanni
Re: USB CDC ACM and 64 bytes transaction
Posted: Sat Nov 16, 2024 9:45 am
by Giovanni
Hi,
Wanted to share some strangeness. I am using Linux Mint as host.
If I start an USB_RAW demo any attempt to use "dd" or "stty" or even "cat" to send/receive data causes the command to hang, presumably on open() of the port (/dev/ttyACMx).
If I 1st open the port using the Eclipse terminal it works (is it doing anything special????), I see the data in the terminal and afterward also dd, stty and cat work as expected. I verified this using both OTGv1 on STM32F746 and USBv2 on STM32G4, this makes me thing that it is not a driver problem because those two drivers are entirely different. Any idea about what could cause this? I added a rule to the "modem manager" to make it not interfere with those ports but no luck.
This is very repeatable.
The second problem is specific of OTGv1, using "dd" with any buffer size greater that 64 does not work, it works with USBv2, this is likely a separate issue.
Adding the retry loop to the ISR made no difference for both issues.
Giovanni