Tool/software: Code Composer Studio
Hi there,
I've been correctly working with USB using CDC on a proprietary board, using CSL library and C5517 device by modifying the CSL_USB_CdcExample.
Due to speed limitations for my application, I decided to use the CPPI DMA provided with the USB controller.
As a start, my goal now is to just correctly enumerate a CDC connection on the host and continuosly transmit from the target a 4 bytes payload (0xABCD1234). with 1 second period. In order to do this I'm not using an host application: I just open a terminal (TeraTerm) so I can monitor the transmitted packets from the device.
Following the "csl_usb_dma_example" I initalize the USB Dma calling
USB_initQueueManager(&hpdtx, linking_ram0);
USB_initDma();
Operation mode as Dma Tx only:
usbConfig.opMode = CSL_USB_OPMODE_DMA_TXONLY;
I correctly see the CDC enumeration and the COM on the host, but when I try to Transmit a packet from the target I don't see it on the Terminal (TeraTerm) and with an USB traffic monitor no data packtes are captured too.
I'm configuring the Dma once, right after "USB_connectDev"
/* Connect the USB device */
status = USB_connectDev(gUsbDevHandle);
if(status != CSL_SOK)
{
printf("USB Connect failed\n");
return(result);
}
// DMA init.
USB_initDma();
USB_initQueueManager(&hpdtx, linking_ram0);
// DMA Tx configuration on EP3.
USB_confDmaTx(CSL_USB_EP3, &hpdtx, usb_income_num_bytes_test, usbDataBuffer3, FALSE);
The variables are defined as followed (buffer2 and buffer 3 are defined on the command file according to the example, so it is located on the SARAM):
CSL_UsbHostPktDescr hpdtx;
Uint16 usb_income_num_bytes_test = 4;
#define CSL_USB_DATA_SIZE 64
#pragma DATA_SECTION(usbDataBuffer3, ".buffer3")
Uint16 usbDataBuffer3[CSL_USB_DATA_SIZE];
#define CSL_USB_LRAM_SIZE (256)
#pragma DATA_SECTION(linking_ram0, ".buffer2")
Uint32 linking_ram0[CSL_USB_LRAM_SIZE];
In order to transmit the packets I execute this function:
while(1)
{
USB_dmaTxStart(CSL_USB_EP3);
wait 1 second...
}
I'm using a FullSpeed USB and due to hardware limitation I can't configure an High Speed connection.
Why do you think this is not working?
I see from the "csl_usb_dma_example" that multiple EP are configured: with CDC the communication EP3 for data from the target to host. Can I only configure the EP3 for Dma Tx?
The CSL function "CDC_OpenFullspeed " forces the usbconfig.opMode for every EP to "CSL_USB_OPMODE_POLLED", why?
Thank you