Project

General

Profile

Actions

Bug #83

closed

Many USB hubs do not work

Added by foft over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
11/03/2019
Due date:
% Done:

0%

Estimated time:

Description

Only the hub I did initial testing with works. Investigate why.

Actions #1

Updated by foft over 4 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!

Actions #2

Updated by foft over 4 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...

Actions #3

Updated by foft over 4 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!

Actions #4

Updated by foft over 4 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!

Actions #5

Updated by foft over 4 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.

Actions #6

Updated by foft over 4 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.

Actions #7

Updated by foft over 4 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.

Actions #8

Updated by foft over 4 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?).

Actions #9

Updated by foft over 4 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!

Actions #10

Updated by foft over 4 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.

Actions #11

Updated by foft over 4 years ago

  • Status changed from New to Resolved
Actions #12

Updated by foft over 4 years ago

  • Status changed from Resolved to Closed
Actions #13

Updated by foft over 4 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.

Actions

Also available in: Atom PDF