当请求来自主机时,我需要能够从FX3中发送4字节。我正在使用一个音频反馈应用程序。我已经通过使用固件项目AbbBulkSuthCink进行了努力。我将端点配置更改为
CYU3PMESET((UIT88T**)和EPCFG,0,SIZEOF(EPCFG));EPCFG使能= CyTress;EpCFG.EpType = CyuU3PUSbBeEpSub;EpCF.BurSTLLN=(UBSTEED= = CyuU3PySuffi Survivin)?(CyfxxEpp-BurSTyLead长度):1;EpCFG.PCKTSIZE=4;DMA设置DMACFG大小=16;DMACFG计数=1;DMACFG.PRODSCKID=CyuU3PycPUCKEKYOPRD;DMACFG.CascSKID=CyfxfxEpCuffeleSerkSoad;DMACFG.dMAMODE=CyuU3PyDMAYMDEDEB字节;DMACFG.IS
tiON = CyuU3PyDMAYBCBIOXIGEL事件;DMACFG.CB=CyfxBulkSrcSnkdCMACARBACK;DMACFG.PRODHOMED=0;DMACFG.PRODHOPETER=0;DMACFG.CONSEADADER=0;DMACFG.PRODFACCESSUTCOUNT=0;我已经初始化了DMA缓冲区,具有计数模式0, 1, 2…14, 15。当我尝试控制中心的例子时,我在运输中得到以下的0000,00,01,02,03,散装,在运输中完成的散货,0000,08,09,0A,0B,在运输中完成的散装,在运输0000中完成的散货0000 01 01 02散装在运输中完成的散装货物在传输完成时,00×08 0A 0B 0B块看起来好像它发送了前4个字节,然后跳过下一个4字节,然后发送下一个4字节。最后的4个字节被跳过,因为我只有1个DMA缓冲器,它再次从顶部开始。我希望它能发送前4个字节,然后用前4个字节重新开始。我还有一个回调函数,但是这只会在每隔一个时间调用(在08个09 0A 0B字节)上。索尼能解释发生了什么事吗?谢谢乔恩
以上来自于百度翻译
以下为原文
I need to be able to send 4 bytes out of the FX3 when a request comes from the host. I am using an audio feedback application. I have exerprimented by using the firmware project USBBulkSourceSink. I changed the endpoint config as below
CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof (epCfg));
epCfg.enable = CyTrue;
epCfg.epType = CY_U3P_USB_EP_BULK;
epCfg.burstLen = (u***Speed == CY_U3P_SUPER_SPEED) ?
(CY_FX_EP_BURST_LENGTH) : 1;
epCfg.streams = 0;
epCfg.pcktSize = 4;
And the DMA setup
dmaCfg.size = 16;
dmaCfg.count = 1;
dmaCfg.prodSckId = CY_U3P_CPU_SOCKET_PROD;
dmaCfg.consSckId = CY_FX_EP_CONSUMER_SOCKET;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.notification = CY_U3P_DMA_CB_CONS_EVENT;
dmaCfg.cb = CyFxBulkSrcSinkDmaCallback;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
I have initilised the DMA buffer with a counting pattern 0, 1, 2 ... 14, 15. When I try the example in control centre I get the following
BULK IN transfer
0000 00 01 02 03
BULK IN transfer completed
BULK IN transfer
0000 08 09 0A 0B
BULK IN transfer completed
BULK IN transfer
0000 00 01 02 03
BULK IN transfer completed
BULK IN transfer
0000 08 09 0A 0B
BULK IN transfer completed
So it seems that it sends the first 4 bytes, then skips the next 4 bytes, then sends the next 4 bytes. The last 4 bytes are skipped then as I have only 1 DMA buffer it starts from the top again. I was expecting it to send the first 4 bytes then start again with the first 4 bytes. I also have a callback function but this only gets called every other time (on the 08 09 0a 0b bytes). Can somone explain what is happening?
Thanks
Jon
0