??? 01/19/06 18:19 Read: times Msg Score: +1 +1 Informative |
#107831 - Acknowledge setup? Responding to: ???'s previous message |
Did you set 'Acknowledge setup' command after receiving the setup packet?
If the host receives ACK correctly, it will issue IN transaction to read the device descriptor. In this IN transaction, you'll send the device descriptor. Mehdi said:
I wrote 16 bytes of device descriptor to ep0in at first
As Grant suggested, split the device descriptor to three part, 8 + 8 + 2 bytes. You define the control EP size as 8 in the device descriptor. So, you cannot send more than 8 bytes at one transaction. The handling sequence of setup transaction is as follows. - Setup packet is received by D12 - D12 interrupts to MCU - 'Read interrupt register' - confirm target EP is control out EP - 'Read last transaction status register' - confirm this packet is Setup packet - 'Select Endpoint' to Control Out EP - 'Read buffer' to MCU memory - 'Clear buffer' - validate packet on the memory: standard device request?, requested bytes? - 'Acknowledge setup' Then move to data stage. - D12 will receive IN transaction from host. - send first 8 bytes of the device descriptor through control IN EP - D12 receives ACK from host If the requested bytes is 8 (maybe BIOS boot), goto status stage If the requested bytes is more than 8 (maybe 64), - D12 will receive IN transaction from host. - send next 8 bytes of the device descriptor - D12 receives ACK from host - D12 will receive IN transaction from host. - send last 2 bytes of the device descriptor - D12 receives ACK from host status stage - D12 will receive OUT transaction: length of 0 Ummm... What a troublesome sequence... Tsuneo |