USB (UHCI) - stalled with some devices, perfect with others.
Posted: Thu Aug 13, 2015 9:46 am
Long time no see.
Not so long ago i found myself in possession of a nice little circa-2000 motherboard, that i wanted to put to use.
And i got curious if i can get Aprom, my old OS project, to work the use on it.
I tried getting USB to work before, but failed (in Qemu it worked perfectly, on real HW failed completely).
4 years later, the old bugs are painfully obvious.
New ones, however, are not.
So, the board only have two UHCI controllers, no EHCI.
I had no problems initializing it, finding the devices and making them work.
Not all of them do.
Some devices, like a mouse or a floppy adapter, don't want to return string descriptors, but otherwise work fine.
SETUP packet completes fine, then the data packet reports STALLED (second word of TD is 0x1C4007FF).
Some devices, like most mass storage ones, don't even get through SET_ADDRESS.
The SETUP packet fails with Stalled and CRC/timeout (0x00440007)
Some devices, like a keypad, don't want to return device descriptor.
SETUP packet completes fine, DATA comes in fine, but the last packet reports STALLED (0x1C400003).
Or SETUP completes fine, then there is Stalled and babble (0x18500007)
Every device exhibits exactly the same behaviour in every port every time.
No randomness.
What works work, what doesn't doesn't each time.
I haven't seen any correlation to it being a low speed or full speed device.
The board can run Linux, and in there all the problem devices work just fine, so it's not something wrong with the hardware.
So, what can be the problem?
The code is rather large, is there any parts in particular that i should post?
Not so long ago i found myself in possession of a nice little circa-2000 motherboard, that i wanted to put to use.
And i got curious if i can get Aprom, my old OS project, to work the use on it.
I tried getting USB to work before, but failed (in Qemu it worked perfectly, on real HW failed completely).
4 years later, the old bugs are painfully obvious.
New ones, however, are not.
So, the board only have two UHCI controllers, no EHCI.
I had no problems initializing it, finding the devices and making them work.
Not all of them do.
Some devices, like a mouse or a floppy adapter, don't want to return string descriptors, but otherwise work fine.
SETUP packet completes fine, then the data packet reports STALLED (second word of TD is 0x1C4007FF).
Some devices, like most mass storage ones, don't even get through SET_ADDRESS.
The SETUP packet fails with Stalled and CRC/timeout (0x00440007)
Some devices, like a keypad, don't want to return device descriptor.
SETUP packet completes fine, DATA comes in fine, but the last packet reports STALLED (0x1C400003).
Or SETUP completes fine, then there is Stalled and babble (0x18500007)
Every device exhibits exactly the same behaviour in every port every time.
No randomness.
What works work, what doesn't doesn't each time.
I haven't seen any correlation to it being a low speed or full speed device.
The board can run Linux, and in there all the problem devices work just fine, so it's not something wrong with the hardware.
So, what can be the problem?
The code is rather large, is there any parts in particular that i should post?