完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,我写信给论坛,因为我真的混淆了GPIF同步FIFO接口的关联线程套接字。我使用从同步FIFO例子(把DMA通道在汽车上)作为起点,但我现在无法继续。
我的需要是: 1)EP1使用自动DMA作为输入和输出数据,从数据端口传送和读取数据。 2)然后,我需要第二个端点EP2也工作进出。 EP1通常用于传输大数据块,并且使用异步数据传输(来自CyAPI点;而不是异步GIPIF)访问。这是完美的,我能够发送和接收数据到GPIF接口。 在这种情况下,你的选择是: *定义CyfxxEpPixPix0x01/*EP 1 out *// *定义*0x81/*EP 1中的CyfxfxEppAuthor 定义了CyfxxPultReSuxBuSocket Cyu3PyuBiSockyPodLy1/1/USB USB套接字1是生产者*/ *定义CyfxfxCuffiSuxBuSocket CyuU3PyuBiSocktisCux1/*USB USB套接字1是消费*/ 定义了CyfxxPuxelyPpPotoSocket CyuU3pPiBiSockt0/*P-端口套接字0是生产者*/ *定义CyfxfxPuxelpPotoSocket CyuU3pPiBiSocky3/*P-端口套接字3是消费者*/ 在参考设计中,使用2个DMA通道设置: … DMACFG.PRODSCKID = CyfxFxPultReuleSubSoCult; DCMAFG.COXSCHAVE=CyfxFuxEuffer-PpPosiSosik; … ApIdReStase= CYU3PDMACHANNEL CREATION(&GLCHANDACLE LIFOUTOP,CYUU3PYDMAX型AUTO,和DMACFG); … 对于USB 2 FX3通道和 … DMACGF.PRODSCKID = CyfxxPuxelyPpPosiSosik; DCMAFG.CascSKID= CyfxfxCuffier-U***SoCult; … ApItReStase= CYU3PDMACHANNEL CREATION(&GLCHANDACLE LIFOPPOTH,CYUU3PYDMAX型AUTO,和DMACFG); 对于FX3 2 USB DMA通道。 第一个问题:如何将USB插槽号映射到端点号。看看你的例子,我应该使用CyuU3PyuuBiSokpO-Pyd1和CyuU3PyuBiSoCuxCux1,EP 1和CyuU3PyuBiSokpKyPrd2和CyuU3PuuBiSoCuxCuxE2为EP2,……这是正确的吗? 为了建立第二组DMA通道,我修改了上面的定义如下 *定义CyfxxEpPixPix0x01/*EP 1 out *// *定义*0x81/*EP 1中的CyfxfxEppAuthor *定义CyfxfxEppGuieldSerix0x02/*EP 2 out *// *定义*0x82/*EP 1中的CyfxfxEpp-Cuffiel** 定义了CyfxxPultReSuxBuSocket Cyu3PyuBiSockyPodLy1/1/USB USB套接字1是生产者*/ *定义CyfxfxCuffiSuxBuSocket CyuU3PyuBiSocktIsCux1/*USB USB套接字1是消费*/ 定义了CyfxxPuxuleSubBocket,新的CyuU3PuuBiSocktPoDy2/2/USB套接字2是生产者*/ *定义CyfxfxEuthuleSubSockType新的CuU3PyuBiSockSocux2.2/*USB套接字2是消费*/ 定义了CyfxxPuxelyPpPotoSocket CyuU3pPiBiSockt0/*P-端口套接字0是生产者*/ *定义CyfxfxPuxelpPotoSocket CyuU3pPiBiSocky3/*P-端口套接字3是消费者*/ 定义了CyfxxPultRealPtPosixSockTo.CyuU3pPiBiSockt1/*P-端口套接字1是生产者*/ *定义CyfxfxCuffelpPotoSockToeCyuU3pPiBiSockt2/2/*P-端口套接字2是消费者*/ 然后我复制你的代码来设置2个新的DMA通道: … DMACFG.PRODSCKID=CyfxfxPuthuleSubbSokKeTeLeNe; DCMAFG.CascSKID= CyfxfxEuthelypPtPosiSokKeNeNeX; … ApIdReStase= CYU3PDMACHANNEL CREATED(&GLCHANHANDSLL FIFOUTPOLY NULL,CYU-U3PYDMAX Type AUTO,和DMACFGGHONE); … 对于USB 2 FX3通道和 … DMACGF.PRODSCKID=CyfxfxPuthelePpPotoSoCKeTyNew; DCMAFG.CascSKID= CyfxfxEuthuleSubBoSoKeLeNeX; … ApIdReStase= CYU3PDMACHANNEL CREATED(&GLCHANDACLLL FIFOPPUTHONE,CYUU3PYDMAX Type M AUTO,和DMACFGGHONE); 第一个问题:根据我所需要的描述,我的Socket映射是正确的吗? 如果是的话,EP1在内外都是完美的,但是EP2根本就没有。 我错过什么了吗?有什么建议吗? 谢谢你,乔尔 P.S.I使用2位ADDR 32位数据同步GPIF从FIFO模型(GPIF设计器) 以上来自于百度翻译 以下为原文 Hi, I’m writing to the forum since I’m really confused about the association Thread-Socket for the GPIF sync FIFO interface. I used the Slave sync FIFO example (putting DMA channels on AUTO) as a starting point but I’m now unable to go ahead. My needs are: 1) EP1 working as IN and OUT, transferring and reading data to and from the PPort using automatic DMA. 2) I then need a second endpoint EP2 working too as IN and OUT EP1 is typically used to transfer big chunk of data and is accessed using async data transfer (from the CyAPI point of view; not async GIPIF!) . This works perfectly and I’m able to send and receive data to/from the GPIF interface. In this case your selection was: #define CY_FX_EP_PRODUCER 0x01 /* EP 1 OUT */ #define CY_FX_EP_CONSUMER 0x81 /* EP 1 IN */ #define CY_FX_PRODUCER_USB_SOCKET CY_U3P_UIB_SOCKET_PROD_1 /* USB Socket 1 is producer */ #define CY_FX_CONSUMER_USB_SOCKET CY_U3P_UIB_SOCKET_CONS_1 /* USB Socket 1 is consumer */ #define CY_FX_PRODUCER_PPORT_SOCKET CY_U3P_PIB_SOCKET_0 /* P-port Socket 0 is producer */ #define CY_FX_CONSUMER_PPORT_SOCKET CY_U3P_PIB_SOCKET_3 /* P-port Socket 3 is consumer */ In your reference design you the set up the 2 DMA channels using : … dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET; dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET; … apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP, CY_U3P_DMA_TYPE_ AUTO, &dmaCfg); .. For the USB 2 FX3 channel and … dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET; dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET; … apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU, CY_U3P_DMA_TYPE_ AUTO, &dmaCfg); For the FX3 2 USB DMA channel. First question: how maps the USB socket number to the Endpoint number. Looking at your example I should use CY_U3P_UIB_SOCKET_PROD_1 and CY_U3P_UIB_SOCKET_CONS_1 for EP 1 and CY_U3P_UIB_SOCKET_PROD_2 and CY_U3P_UIB_SOCKET_CONS_2 for EP2,… is this correct ? In order to set up a second group of DMA channels I modified the above definition as following #define CY_FX_EP_PRODUCER 0x01 /* EP 1 OUT */ #define CY_FX_EP_CONSUMER 0x81 /* EP 1 IN */ #define CY_FX_EP_PRODUCER_NEW 0x02 /* EP 2 OUT */ #define CY_FX_EP_CONSUMER_NEW 0x82 /* EP 1 IN */ #define CY_FX_PRODUCER_USB_SOCKET CY_U3P_UIB_SOCKET_PROD_1 /* USB Socket 1 is producer */ #define CY_FX_CONSUMER_USB_SOCKET CY_U3P_UIB_SOCKET_CONS_1 /* USB Socket 1 is consumer */ #define CY_FX_PRODUCER_USB_SOCKET_NEW CY_U3P_UIB_SOCKET_PROD_2 /* USB Socket 2 is producer */ #define CY_FX_CONSUMER_USB_SOCKET_NEW CY_U3P_UIB_SOCKET_CONS_2 /* USB Socket 2 is consumer */ #define CY_FX_PRODUCER_PPORT_SOCKET CY_U3P_PIB_SOCKET_0 /* P-port Socket 0 is producer */ #define CY_FX_CONSUMER_PPORT_SOCKET CY_U3P_PIB_SOCKET_3 /* P-port Socket 3 is consumer */ #define CY_FX_PRODUCER_PPORT_SOCKET_NEW CY_U3P_PIB_SOCKET_1 /* P-port Socket 1 is producer */ #define CY_FX_CONSUMER_PPORT_SOCKET_NEW CY_U3P_PIB_SOCKET_2 /* P-port Socket 2 is consumer */ I then copied your code to set up the 2 new DMA channels: … dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET_NEW; dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET_NEW; … apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP_new, CY_U3P_DMA_TYPE_ AUTO, &dmaCfg_new); .. For the USB 2 FX3 channel and … dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET_NEW; dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET_NEW; … apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU_new, CY_U3P_DMA_TYPE_M AUTO, &dmaCfg_new); First question: is my socket mapping correct according to the description of what I need ? If yes, EP1 works perfectly both IN and OUT, but EP2 simply doesn’t. In none of the directions… Do I’m missing something? Any suggestion ? Thanks in advance, Joel P.S. I’m using a 2 bit addr 32 bit data sync GPIF slave fifo model (GPIF designer) |
|
相关推荐
1个回答
|
|
啊,对不起,我完全忘了提什么“不工作”的意思。
如果我把地址= 2(soket 2 /线程2 GPIF SEL)和我写4字节的EP2上cmdendptout - >;xferdata(…)我能写2次xferdata FX3(自从我2缓冲区设置一个DMA通道),然后在下一个xferdata操作中止对超时。监测标志(已分配给当前线程fifo_full /空功能)仍然很低,因此DMA不将所接收到的数据传送到支持。 它似乎在这种情况下,生产商的部分工作正常但有在DMA操作或在通道出口部分错误的东西。 有什么明显的错误吗? 谢谢,乔尔 以上来自于百度翻译 以下为原文 Ah sorry, I completely forgot to mention what "doesn't work" means. If I set addr = 2 (soket 2/thread 2 GPIF sel) and I write 4 bytes to EP2 usign CmdEndPtOut->XferData(…) I’m able to write 2 times an XferData to FX3 ( since I’ve set up a DMA channel with 2 buffers) but then at the next XferData the operation aborts on timeout. Monitoring FlagA (which has been assigned to current thread FIFO_full/empty functionality) it remains low ergo the DMA doesn’t transfers the received data to the PPort. It seems somehow that the producer part in this case is working properly but there is something wrong on the DMA operation or on the egress part of the channel. Any evident mistake ? Thanks, Joel |
|
|
|
只有小组成员才能发言,加入小组>>
750个成员聚集在这个小组
加入小组2055 浏览 1 评论
1811 浏览 1 评论
3622 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1747 浏览 6 评论
1499 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
484浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
339浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
401浏览 2评论
343浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
836浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-10 16:13 , Processed in 0.672688 second(s), Total 44, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号