At the endpoint 0, could not send a multiple of 8 bytes of data.
After sending data to the device, It seems that the host requests more data.
I'm handling DATAEND bit in the PERI_CSR0 register properly.
I have miss something?
m.asada
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
At the endpoint 0, could not send a multiple of 8 bytes of data.
After sending data to the device, It seems that the host requests more data.
I'm handling DATAEND bit in the PERI_CSR0 register properly.
I have miss something?
m.asada
Asada-san,
Could you please provide the context of which the USB transfer occurs. Can I assume you are operating at full speed due to 8 byte transfers on Endpoint 0?
I'm afraid that we cannot provide any feedback due to lack of information regarding the context of the USB transfer.
In general, the last packet should set DATAEND along with TXPKTRDY with the last transfer. I assume you set TXPKTRDY as well however.
Asada-san,
I can see a STALL handshake packet for IN token in SOF number 324, are you suppose to send more data at frame#324? or host should not have sent In token as this was the end of data.
what is the total length of data being transferred as multiple of 8 bytes? Is this configuration descriptor data being sent?
Regards,
Ajay
Dear Mr. Drew,
My last message was translated by Google translation web (from Japanese),
since I'm not good at writing English. I'm afraid that my message was
correctly translated in English.
Therefore, I asked my colleague the translation from Japanese to English.
I hope that the following reflects my situation more better:
---
I'm not exactly sure what you are asking me for 'context', but let me
explain the context : 'the way of packet processing'.
The attached image was taken by my USB analyzer with conditions;
- Full speed transmission at endpoint 0
- It shows a transaction between host and device just after the device recognition.
The following code is a transmit control:
---- start of code ----
static void *ep0_st_tx( void )
{
UB i;
/* Write <= MaxP bytes to FIFO */
if ( ep0_txlen < ep0_txsz )
{
for( i = 0; i < dsc_device.bMaxPacketSize0; i++ )
{
(*(volatile UB *)(&(USB0->FIFO0))) = *ep0_txptr++;
if ( ++ep0_txlen >= ep0_txsz )
{
break;
}
}
}
/* Last packet ? */
if ( ep0_txlen >= ep0_txsz )
{
/* Set TxPktRdy and set DataEnd, state -> IDLE */
USB0->TXCSR.PERI_CSR0 |= (CSR0_DATAEND | CSR0_TXPKTRDY);
return (void *)ep0_st_idle;
}
else
{
/* Set TxPktRdy */
USB0->TXCSR.PERI_CSR0 |= CSR0_TXPKTRDY;
}
return (void *)ep0_st_tx;
}
---- end of code ----
Dear Mr. Ajay,
The sending data was a response to the OID_GEN_SUPPORTED_LIST query of RNDIS.
This query includes the device list supported and I found out that the host
responds with a 'STALL' status when the data byte size is just a multiple of 8.
According to the image attached, I assume that host complete the transmission
since the data byte size is 80 bytes.
The control of the device (sending) side is described in my previous message.
I guess I surely set DATAEND, TXPKTRDY on PERI_CSR0 because of the state transition
from TX(ep0_st_tx) to IDLE(ep0_st_idle).