I am trying to transfer bytes from DDR to a USB bulk endpoint at a fast data rate (>15MB/s). I started with the usb_dev_bulk example project, running on a BeagleBoneBlack. I defined DMA_MODE, included cppi4dma.h, initialized the DMA with the following code:
endpointInfo epInfo[] = { { USB_EP_TO_INDEX(USB_EP_1), CPDMA_DIR_RX, CPDMA_MODE_SET_TRANSPARENT, }, { USB_EP_TO_INDEX(USB_EP_1), CPDMA_DIR_TX, CPDMA_MODE_SET_GRNDIS, } }; #define NUMBER_OF_ENDPOINTS 2 //Total number of send points(RX +TX) used in this USB configuration
--------------------------------------------
tBulkInstance *psInst; tUSBDBulkDevice *psDevice = (tUSBDBulkDevice *)&g_sBulkDevice; // Get a pointer to our instance data. psInst = psDevice->psPrivateBulkData; Cppi41DmaInit(USB_INSTANCE, epInfo, NUMBER_OF_ENDPOINTS);
I am successfully able to transmit some bytes using the following two lines of code , but my program eventually crashes after a few megabytes.
doDmaTxTransfer(USB_INSTANCE, 0x80000000,65536, psInst->ucINEndpoint); enableCoreTxDMA(USB_INSTANCE, psInst->ucINEndpoint);
1. Is it necessary to call cppiDmaAllocBuffer() if I'm transferring from DDR anyway? 0x80000000 is the start of DDR which contains my data. I can verify this works with a few bytes.
2. If I put those two lines of code in a loop to continuously send data, it crashes. What do I need to watch for to make sure the transmit is complete before sending more? The crash says "UndefInstHandler() 0x8000F508 (next frame is identical to an existing frame)". How can I figure out what is causing the crash? Am I not handling a callback or an interrupt?
3. Is there some documentation for the "cppi41dma.h" API so I don't have to randomly guess how to call the proper functions?
Thanks!
-marc