Closed jeremyherbert closed 12 months ago
The situation seems to improve if use usb_serial.tx.first.eq(0)
, there are still some orphaned packets but far less. However, this comment: https://github.com/greatscottgadgets/luna/blob/c7617ec7b7903a6d8e1fa4f4a637bbfedb2b0616/luna/gateware/usb/usb2/transfer.py#L39C30-L39C30
seems to imply that first
is unused, so I'm even more confused now.
Hi, can you try doing a sequential mode capture with the beagle? The captures you've attached are aggregate mode which discards some details, making it hard to see exactly what's going wrong.
This one has tx.first
and tx.last
tied to 1 (there are a lot more errors than previously for some reason):
luna_usb_serial_sequential.tdc.zip
Is this the correct format?
Yes, thanks. The packets that's showing up as orphaned are IN requests from the host without a handshake from the device. Normally the device should reply NAK to every IN token it receives when it doesn't have any data to respond with, but in the capture roughly one in two thousand IN tokens on average doesn't get a reply.
I believe this is a lower layer problem than the FIFO signals you've been experimenting with, and wouldn't expect them to actually affect the behavior.
The reason the data is still coming through fine is because this is well within what USB's error handling can deal with and recover from, but the rate this is occuring at still suggests this is a problem that should be tracked down and fixed.
I'll try porting your code to one of my boards here tomorrow and see if I can reproduce the issue.
Thank you. Please let me know if there is anything I can do to help test - I'm not too comfortable with the deeper internals of this code but happy to do what I can.
I'm unable to reproduce your issue, it's behaving fine here:
Statistics shows no missed replies to over 10M IN requests:
I'm testing on a colorlight i5 in a custom carrier board with a FS USB connector and apart from changing the PLL config to account for the input clock being 25 MHz instead, I'm running the exact code you provided.
Well this is embarrassing... It appears that the USB-C cable I was using was causing signal integrity issues. I have changed to a known high-quality cable and now everything works fine.
I will close this issue. Thanks very much for the reproduction attempt and sorry for wasting your time.
Thank you for the update. We're happy that you were able to find a solution!
Hi,
I'm running the LUNA latest git rev with a custom ECP5 board (but that is very similar to the OrangeCrab or other small dev boards).
I'm trying to use the CDC ACM interface and while it seems to be working fine, I am seeing orphaned packets inside the beagle analyzer log:
The data appears to be coming through OK to my serial terminal though.
My code is below, the expectation is that it sends "SRQ" as three separate packets repeatedly:
The Beagle trace is also attached. luna_usb_serial_issue.tdc.zip
This isn't a huge problem in itself, but the errors become much more extreme if I try to send the data as a single packet with multiple bytes in it by changing:
to
trace: luna_usb_serial_issue_single_packet.tdc.zip
But the data is still coming through OK in the serial terminal.
Could you please help me understand if I am doing something wrong here?