Hi,
I use the C5515 and I want to realize USB communication.
I have 2 versions of USB code - let's call them custom and HID - which I've developped by taking USB-DMA-interrupt example code for the C5515 and adapting it to my own needs. If I run things by emulator (i.e. code composer studio) both versions work as they should.
But when I try the versions by booting from FLASH, I have the following behavior:
- the HID version works correctly
- the custom version brings down the C5515 at USB configuration/enumeration
What is strange is that in both versions I use quite the same enumeration firmware (except that I have different descriptors). The main difference in the code is after enumeration how to do data transmission : in HID version I write to FIFOs directly, in custom version i use CSL USB-DMA functions.
Do you know what might be wrong or missing with the custom version? Does it miss any device configuration? In main() I have the following to configure the C5515:
// clock setup
IDLE_PCGCR = 0;
IDLE_PCGCR_MSW = 0;
CONFIG_MSW = 0x0;
PLL_CNTL1 = 0x8BE8;
PLL_CNTL2 = 0x8000;
PLL_CNTL3 = 0x0806;
PLL_CNTL4 = 0x0000;
while ( (PLL_CNTL3 & 0x0008) == 0);
CONFIG_MSW = 0x1;
// ...
CSL_FINST(CSL_SYSCTRL_REGS->EBSR, SYS_EBSR_PPMODE, MODE6);
CSL_FINST(CSL_SYSCTRL_REGS->EBSR, SYS_EBSR_SP1MODE, MODE2);
CSL_FINST(CSL_SYSCTRL_REGS->EBSR, SYS_EBSR_SP0MODE, MODE2);
// ...
gpio_handle = GPIO_open(&gpio_obj,&gpio_status);
if((NULL == gpio_handle) || (CSL_SOK != gpio_status)) {
return FALSE;
}
GPIO_reset(gpio_handle);
gpio_handle->baseAddr->IODIR1 = 0x7000; // enable write on pins 14:12
gpio_status = GPIO_write (gpio_handle, CSL_GPIO_PIN13, 1);
if (CSL_SOK != gpio_status) {
return FALSE;
}
// ... send some data on GPIO ...
// ...
// USB config...
// Initialize the Bulk Endpoint IN 1
// ... custom version
status = USB_initEndptObj(CSL_USB0, hEpObjArray[2], CSL_USB_IN_EP1, CSL_USB_INTR, 512, eventMask, NULL);
// ... HID version
status = USB_initEndptObj(CSL_USB0, hEpObjArray[2], CSL_USB_IN_EP1,
CSL_USB_INTR, 64, eventMask, NULL);
// Initialize the Bulk Endpoint OUT 2
// ... custom version
status = USB_initEndptObj(CSL_USB0, hEpObjArray[3], CSL_USB_OUT_EP2,
CSL_USB_INTR, 512, CSL_USB_EVENT_EOT, NULL);
// ... HID version
status = USB_initEndptObj(CSL_USB0, hEpObjArray[3], CSL_USB_OUT_EP2, CSL_USB_INTR, 64, CSL_USB_EVENT_EOT, NULL);
Do you need more code? Or any ideas what and how I could test and check?
Thank you for all your help.
Best regards,
Andreas