USB CDC ACM and 64 bytes transaction
Re: USB CDC ACM and 64 bytes transaction
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.
- Attachments
-
- patches.zip
- (7.01 KiB) Downloaded 17 times
- Giovanni
- Site Admin
- Posts: 14535
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1098 times
- Been thanked: 934 times
- Contact:
Re: USB CDC ACM and 64 bytes transaction
Hi,
Is that an USB analyzer that you use for those logs or some kind of SW?
Giovanni
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
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.
- Giovanni
- Site Admin
- Posts: 14535
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1098 times
- Been thanked: 934 times
- Contact:
Re: USB CDC ACM and 64 bytes transaction
Hi,
Thanks Bob, I was just searching for something like this, usually analyzers are not that cheap.
Giovanni
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
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)
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)
- Giovanni
- Site Admin
- Posts: 14535
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1098 times
- Been thanked: 934 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14535
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1098 times
- Been thanked: 934 times
- Contact:
Re: USB CDC ACM and 64 bytes transaction
Hi,
What I am seeing using the USB_RAW demo on an STM32F746:
Reading data from the demo always works using:
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.....
So far I have not an explanation for this, adding the retry to the ISR does not help.
Giovanni
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
- Giovanni
- Site Admin
- Posts: 14535
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1098 times
- Been thanked: 934 times
- Contact:
Re: USB CDC ACM and 64 bytes transaction
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
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
Who is online
Users browsing this forum: No registered users and 5 guests