I have a custom USB HOST class driver that is working great with DMA_MODE not defined. I have been looking at usb_host_msc.c to try to figure out how to get DMA_MODE working with my app.
From looking at usb_host_msc.c, it appears I need to:
- #define DMA_MODE in all the right places
- Create an endpointInfo epInfo[] structure (see below)
- Create function CPDMAAINTCConfigure() and call it from USBInterruptEnable()
- I think I can reuse CPDMAAINTCConfigure() code from usb_host_msc.c as-is
- Call Cppi41DmaInit(USB_INSTANCE,epInfo,NUMBER_OF_ENDPOINTS) in my main()
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,
},
{
USB_EP_TO_INDEX(USB_EP_2),
CPDMA_DIR_RX,
CPDMA_MODE_SET_TRANSPARENT,
},
{
USB_EP_TO_INDEX(USB_EP_2),
CPDMA_DIR_TX,
CPDMA_MODE_SET_GRNDIS,
}
};
This appears to be setting up DMA for both Tx and Rx on both endpoints 1 and 2. Also, I thought that GRNDIS didn't work on the Beaglebone and only TRANSPARENT could be used.
My custom USB device uses two BULK endpoints (1 = IN, 2 = OUT). Would the following structure properly support USB DMA for my remote peripheral device (BB is in USB HOST mode):
endpointInfo epInfo[]=
{
{
USB_EP_TO_INDEX(USB_EP_1),
CPDMA_DIR_RX,
CPDMA_MODE_SET_TRANSPARENT,
},
{
USB_EP_TO_INDEX(USB_EP_2),
CPDMA_DIR_TX,
CPDMA_MODE_SET_TRANSPARENT,
}
};
I've set both as TRANSPARENT DMA and EP1 as IN and EP2 as out. I'm not sure if this is correct.