??? 01/23/06 01:14 Read: times |
#108055 - declared in bMaxPacketSize Responding to: ???'s previous message |
Mehdi said:
Why i must split descriptors to 8 bytes pieces while Both control Endpoints are 16 bytes buffer? It's because 'bMaxPacketSize' in the device descriptor is defined as 8, as you showed in your first post. MOV bMaxPacketSize,#08H 'bMaxPacketSize' in the device descriptor declares the maximum number of bytes that the control EP receives/sends in a single packet (transaction). 8 is fairly common value for mouse, keyboard, etc. Do you actually set 'bMaxPacketSize' to 8 still now? If you change it to 16, you can use full 16 bytes buffer. Don't use 'fixed number'. Declare it as a constant with EQU and use this constant both for 'bMaxPacketSize' and in the packet split routine. It is better to code your firmware so that it works properly even if you change 'bMaxPacketSize'. On GET_DESCRIPTOR request, firmware must return smaller number of bytes of - the size of the requested descriptor - the size requested by GET_DESCRIPTOR in wLength field Sometimes host requests smaller number than descriptor size. For example, on BIOS boot, host requests 8 bytes for device descriptor. Therefore, the code flow is - Determine number of return bytes comparing the descriptor size and wLength field. - Split it into 'bMaxPacketSize' Tsuneo |