[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [usb] Usb1.1: Minor inconsistent behaviour



On Sunday, Jul 6, 2003, at 01:48 Canada/Eastern, Marc Reinig wrote:
>> `define	ROM_SIZE1	7'd032	// Configuration Descriptor Length
> 	The length of a configuration descriptor is 9.  There is also Total 
> Length
> which includes the configuration, interface and endpoint descriptors.  
> For
> the device you described, that would be 9 + 9 + 6 + 6 = 30.  So, I'm
> confused by the 32.

Wait, as far as I am aware, the endpoint descriptors are 7 bytes long 
(USB1.1 Spec section 9.6.4, table 9-10:

bLength (1)
bDescriptorType (1)
bEndpointAddress (1)
bmAttributes (1)
wMaxPacketSize (2)
bInterval (1)
1*5+2 = 7

9 + 9 + 7 + 7 = 32

So I believe the configuration length is correct.

>> `define	ROM_SIZE2A	7'd004	// Language ID Descriptor
> 	Don't know what this is

It is supposed to be the length of the language ID descriptor

>> 	   7'h32:	dout <= #1 8'd04;	// this descriptor
>>                                   // length IT SHOULD READ
>> 						// THE LANG IDS STARTING HERE
>> 	   7'h33:	dout <= #1 8'd03;	// descriptor type
>> 	   7'h34:	dout <= #1 8'd09;	// Language ID 0 low byte
>> 	   7'h35:	dout <= #1 8'd04;	// Language ID 0 high byte
> 	This seems correct.  Only one language is supported, English.

Correct

>> 	   7'h36:	dout <= #1 8'd020;	// this descriptor length
> 	Are you saying the length is 20?  Looks like 10 to me.

Sorry, that is correct.

>> 	   7'h37:	dout <= #1 8'd03;	// descriptor type
> 	This is a string descriptor, that is correct.
> 	The string below should be Unicode.  Do the values below somehow get
> translated to unicode somewhere?  If they do, the string descriptor 
> length
> should be 18, not 20.

I know that they should be Unicode, but for now we can't get them to be 
read correctly, so that doesn't matter. I'll worry about that when the 
time comes.

>> 	   7'h38:	dout <= #1 "0";
>> 	   7'h39:	dout <= #1 " ";
>> 	   7'h3a:	dout <= #1 "g";
>> 	   7'h3b:	dout <= #1 "n";
>> 	   7'h3c:	dout <= #1 "i";
>> 	   7'h3d:	dout <= #1 8'd04;
>> 	   7'h3e:	dout <= #1 8'd03;
>> 	   7'h3f:	dout <= #1 8'd09;
> 	Don't understand the last three entries.

They were inserted for testing purposes. Below I've posted a 
"corrected" version of the rom that should be clearer.


Thanks for your assistance,

Evan Jones

		// ====================================
		// ===== String Descriptor Lang ID=====
		// ====================================

	   7'h32:	dout <= #1 8'd04;	// IT SHOULD READ THE LANG IDS STARTING 
HERE
	   7'h33:	dout <= #1 8'd03;	// descriptor type

	   7'h34:	dout <= #1 8'd09;	// Language ID 0 low byte
	   7'h35:	dout <= #1 8'd04;	// Language ID 0 high byte


		// ====================================
		// =====   String Descriptor 1    =====
		// ====================================

	   7'h36:	dout <= #1 8'd020;	// this descriptor length
	   7'h37:	dout <= #1 8'd03;	// descriptor type
	   7'h38:	dout <= #1 "1";
	   7'h39:	dout <= #1 " ";
	   7'h3a:	dout <= #1 "g";
	   7'h3b:	dout <= #1 "n";
	   7'h3c:	dout <= #1 "i";
	   7'h3d:	dout <= #1 "r";
	   7'h3e:	dout <= #1 "t";
	   7'h3f:	dout <= #1 "S";

		// ====================================
		// =====   String Descriptor 2    =====
		// ====================================

	   7'h40:	dout <= #1 8'd04;	// this descriptor length
	   7'h41:	dout <= #1 8'd03;	// descriptor type
	   7'h42:	dout <= #1 "2";
	   7'h43:	dout <= #1 " ";
	   7'h44:	dout <= #1 "g";
	   7'h45:	dout <= #1 "n";
	   7'h46:	dout <= #1 "i";
	   7'h47:	dout <= #1 8'd04; // BUT IT ACTUALLY READS THE
	   7'h48:	dout <= #1 8'd03; //  LANGUAGE ID TABLE STARTING HERE
	   7'h49:	dout <= #1 8'd09; // AND IT READS 4 BYTES

		// ====================================
		// =====   String Descriptor 3    =====
		// ====================================

	   7'h4a:	dout <= #1 8'd04;	// // INCLUDING THIS BYTE
	   7'h4b:	dout <= #1 8'd03;	// descriptor type
	   7'h4c:	dout <= #1 "3";
	   7'h4d:	dout <= #1 " ";
	   7'h4e:	dout <= #1 "g";
	   7'h4f:	dout <= #1 "n";
	   7'h50:	dout <= #1 "i";
	   7'h51:	dout <= #1 r;
	   7'h52:	dout <= #1 "t";
	   7'h53:	dout <= #1 "S";

--
Evan Jones: http://www.eng.uwaterloo.ca/~ejones/
"Computers are useless. They can only give answers" - Pablo Picasso

--
To unsubscribe from usb mailing list please visit http://www.opencores.org/mailinglists.shtml