USB CDC ACM and 64 bytes transaction Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14563
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1111 times
Been thanked: 937 times
Contact:

Re: USB CDC ACM and 64 bytes transaction

Postby Giovanni » Sun Nov 17, 2024 10:01 am

It turned out that the problem with non-receiving data before launching the terminal was caused by "cocked" mode of the serial port, by adding a \n to the data stream made the problem disappear, the terminal SW simply selected "raw" mode and it sticks even after exiting the terminal.

Still looking into the other problem.

Giovanni

Dron_Gus
Posts: 19
Joined: Wed Apr 22, 2020 1:03 am
Has thanked: 2 times
Been thanked: 5 times

Re: USB CDC ACM and 64 bytes transaction

Postby Dron_Gus » Sun Nov 17, 2024 4:05 pm

Hi Giovanni,

Thanks for looking into this. Let me know if I can help.
We have merged my workaround into RusEFI master and as far a I know our problem is not longer reproducible.

User avatar
Giovanni
Site Admin
Posts: 14563
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1111 times
Been thanked: 937 times
Contact:

Re: USB CDC ACM and 64 bytes transaction

Postby Giovanni » Mon Nov 18, 2024 1:39 pm

hi,

Fixed another problem with the number of bytes returned by usbReceive(), it was higher than the real value under certain conditions.

About the frames exactly 64 bytes, the driver does not notify for data because the host sends no zero packet, the driver assumes that more frames follows as specified by the USB protocol, there is nothing that can be done on the device side, it is the host.

Other issue specific of this OTG peripherals, it has an unified RX FIFO, if there are multiple OUT endpoints the application needs to greedly read data or one unread frame can keep in queue frames of other endpoints indefinitely, again, this is not something that can be fixed in the driver unless we adopt a policy of dropping unread frames.

Please report about the current driver state in your use case if possible. I still need to make other standby-related changes but I wish to have a stable state 1st.

Giovanni

Dron_Gus
Posts: 19
Joined: Wed Apr 22, 2020 1:03 am
Has thanked: 2 times
Been thanked: 5 times

Re: USB CDC ACM and 64 bytes transaction

Postby Dron_Gus » Tue Jan 28, 2025 3:01 pm

Hi Giovanni,

Few months have passed, no more communication stuck reported from users. So I can confirm that setting SERIAL_USB_BUFFERS_SIZE equal to EP size fixes/workarounds the problem.
I agree that driver does not sends ZLP and this looks correct to me. As it is serial device and there is no actual "end of block".

Andrey.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 7 guests