Bug #83
closedMany USB hubs do not work
0%
Description
Only the hub I did initial testing with works. Investigate why.
Updated by foft about 5 years ago
I've known about this for a long time but have never really looked into it, since its a pain and hubs are not that important (we have two ports and real controller ports).
I had an idea on how to debug, I could use the SOCkit which runs linux. I already tried a bridge over to FPGA side for that, should be fairly simply to wire up a usb port on the expansion header then connect usbhostslave to it. Then I can debug my existing usb firmware code from linux.
This will probably take me weeks in reality but should be fun!
Updated by foft about 5 years ago
Managed to get the SOCkit board up and running and set up linux.
Now going to build/flash the existing 800 core as a hello world...
Updated by foft about 5 years ago
Well I can flash it and get sync on vga, but no dice. I remembered I needed to run the firmware binary. I flashed the FPGA (after disabling gpio kernel module and tool) ok from linux. Then I tried to start SOCKIT.ELF, which promptly crashed linux. Perhaps its just hanging on writing to the bridge. Something to investigate another night!
Updated by foft about 5 years ago
Managed to get the core flashing ok (was bad rbf generation).
Also installed gcc and the binaries are running ok.
Can read/write the os rom + ram via dma.
Have sync on vga, but it doesn't boot.
So... this is probably enough to now build a USB bridge to debug stuff, but I'm curious why it doesn't boot so might fix that first!
Updated by foft about 5 years ago
Updating the avalon arm regs, to the latest zpu config regs. Which has USB...
Will also add another avalon slave which puts all the bus transactions into a fifo, so I can debug those from the arm too.
Updated by foft about 5 years ago
Wired up the USB to gpio, added another pll for the pll clock.
Now will get the software to poll usb and see if I get anything on the gpio port. If I do a few resistors and a little plumbing and I can connect a USB keyboard to try.
Updated by foft about 5 years ago
OK, circuit build and wired up. I can type on the sockit.
Now to get some debugging in place and try the hub.
Updated by foft about 5 years ago
The hub is detected as connected, then it tries to set the address and fails.
So, the keyboards I'm using are low speed, while the hub I'm using is full speed.
On the low speed I see SE0, followed by JKJKJK (i.e. sync)
On the high speed I see straight away JKJKJK - no SE0. Also the saleae is not detecting these as J/K for some reason (does it need SE0?).
Updated by foft about 5 years ago
This setup is so much better for debugging than on the Eclaire. I have gdb on linux to debug the binary, I can printf to the terminal and I can see the packets with the saleae. If I can't fix it now then... Still sure it'll take me some days yet!
Updated by foft about 5 years ago
Got it, I needed to set the line control earlier on. It was set to 'NORMAL' after the reset and this leads to the SET_ADDRESS being ignored.
Updated by foft about 5 years ago
Just did a bit more testing. Two hubs, two keyboards and a joystick. Fiddled with unplugging/re-plugging etc and all seeming good now.