I have some questions concerning the CSL 3.03/C5505 USB. Yes, I am using a revised csl_usbAux.h in addition to the CSL-as built to deal with data length>64 bytes.
I am using USB_postTransaction to receive OUT transfers (Set feature report) and send IN transfers (Get feature report) to Ep0. These are 80-byte transfers with a PC host and are working correctly except for the C5505 receive. I am setting an EOT event in the transfer complete callback routine but there is no data changed in the buffer when the Ep0 handler tries to process it.
I use the CSL_USB_IOFLAG_SWAP I/O flag to request a byte-order swap of (little endian) received data by USB_postTransaction as in previous versions (5509A). It is likewise used to request a swap of data bytes before sending to host with IN transfers. The USB analyzer shows the first word coming in as 0x0055 (HostCmd=ReadMemory) with correct data following it. The analyzer is set for displaying little endian in this case. The analyzer shows C5505 correctly responding to host (IN transfer) when I swap the bytes instead of relying on USB_postTransaction to do it (swap flag).
I am using the existing PC host (code updater) application to exercise this on our C5505 target.
Does CSL v3.03 handle these I/O flags correctly? Are there subtle differences in the way these need to be addressed with C5505/CSL?
Can you explain the missing data problem with the OUT transfer?
Thanks,
Stephen
Our application uses a standard Windows HID driver on the PC host.
//code snippet from my HIDSetReport request handler
case 3: // Set Feature report
{
ii = 80;
// select the smaller of the two
ii = (ii < USB_Setup->wLength) ? ii : USB_Setup->wLength;
// hUsbDev->ep0State = CSL_USB_EP0_RX;
if(USB_isTransactionDone(hOutEp,&status))
{
status = USB_postTransaction(hOutEp, ii, (void*)&featureReport.reportData[1], CSL_USB_IOFLAG_NOSHORT/*|CSL_USB_IOFLAG_SWAP*/);
for (j=1; j<41; j++) //swap high/low bytes
{
/* temp = (featureReport.reportData[j] & 0xFF)<<8;
temp |= ((featureReport.reportData[j]>>8) & 0xFF);
featureReport.reportData[j] = temp; */
}
receivingFeatureReport = 1;
// Service the RXPKTRDY after reading the FIFO
// USB_clearEpRxPktRdy(CSL_USB_EP0);
}
break;
}
///this is the structure of the commands and replies transported by Set/Get feature report
typedef union
{
Uint16 reportData[41];
struct
{
Uint16 reportID;
Uint16 hostCmd;
Uint32 startAddress;
Uint16 count;
Uint16 key[4];
Uint16 flashData[32];
} report;
} FeatureReport;