mindentropy wrote:
I tried sending the SET_ADDRESS request. I still get the "device not responding" error (0101) in the CC field of the TD.
I have the following register dump:
Before sending the packet:
Port status after reset (HcRhPortStatus register):
Port1 : 0x00100103
Port2 : 0x00000100
Did you clear bit 20? The hardware may or may not end the reset state until you acknowledge the finish of the reset by writing a '1' to bit 20.
mindentropy wrote:
<snip ED and TD dumps>
Is my port status fine? If I try to clear the PRSC bit by writing a 1 to it I get the status changes back to 0x00000100. Is this normal?
Yep, I guess you did clear the bit. You should do this before sending any TD's.
Rather than interpret your ED and TD's, I am going to show you the example ED with two TD's that will set the address:
Code:
// ED at physical address 0x01234000:
0x00082000 // control
0x01234030 // tail
0x01234010 // head
to next ED // next ed
// first TD at physical address 0x01234010:
0xE2E00000 // control
0x01234030 // Current Buffer Pointer
0x01234020 // Next TD
0x01234037 // Buffer End (8 bytes)
// second TD at physical address 0x01234020:
0xE3100000 // control
0x00000000 // Current Buffer Pointer (none)
0x01234030 // Next TD (Doesn't matter, but our loop gave us a pointer to here plus 0x10)
0x00000000 // Buffer End (none)
// Packet at physical address 0x01234030:
0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
Of course you will need to adjust the physical addresses to match your setup, but this gives an idea.
Just a note. Some devices require that you get the first 8 bytes of the descriptor using the default address *before* you reset and set the address. Therefore, you should reset the device, request the first 8 bytes of the Device Descriptor, reset the device again, then send the Set Address request.
Some manufacturers made their devices work on certain platforms with certain operating systems. If it works on that system, no need to test otherwise. A certain, major operating system does exactly this sequence, so some devices expect this sequence and won't work if it doesn't see it.
Fun huh?
Ben