完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
大家好,我的应用(复合装置UVC + cdc-acm)我需要从FX3 UART接收单字节并转发给相应的CDC散装EP ..使用DMA不工作,因为数据只会在一个缓冲区被填充转移,这意味着至少16个字节必须读。当使用UART在登记模式的功能cyu3puartreceivebytes(…)似乎没有字节可用块一会儿整个系统,即使我在一个单独的线程中使用它!有可能避免这种情况吗?
以上来自于百度翻译 以下为原文 Hi all, for my Application ( Composite Device UVC + CDC-ACM ) I need to receive single bytes from the FX3 UART and forward them to the appropriate CDC Bulk EP.. Using DMA doesn't work because the data will transferred only if a buffer is filled, what means that at least 16 bytes have to be read. When using the UART in register mode the function CyU3PUartReceiveBytes(...) seems to Block the whole system for a while if no bytes are available, even if I use it in a separate thread! Is there any possibility to avoid this? |
|
相关推荐
6个回答
|
|
你好,
请参阅FX3RelaseNoto.PDF文件在已知的问题,为什么DMA模式不工作… 7。任何DART模式下的UART/I2C/SPI读取传输不会填充整个DMA缓冲区,不会触发DMA回调或传输完成事件。应用程序需要检查基于UART/I2C/SPI事件的传输完成,然后在DMA信道上调用CYU3PDMACHANEL SETRAWAPUP()API。 对于ReX模式,RX上的设备必须发送一些东西,否则错误代码超时从函数调用返回,并且您可以处理它。 当做, 隆皮 以上来自于百度翻译 以下为原文 Hi, see FX3ReleaseNotes.pdf file at known issues why DMA mode is not working.... 7. Any UART/I2C/SPI read transfers in DMA mode that do not fill up the entire DMA buffer will not trigger a DMA callback or a transfer complete event. The application needs to check for transfer completion based on the UART/I2C/SPI events and then invoke the CyU3PDmaChannelSetWrapUp() API on the DMA channel. For register mode your device on the rx has to send something, otherwise the error code timeout is returned from the function call and with that you may be can handle it. regards, lumpi |
|
|
|
我用CYU3PREGSTUARARTCUBACK()注册了一个中断回调函数。
但我没有收到任何事件。回调函数从不被调用。 我必须启用UART中断吗?如果是的话,我怎么办呢? 当做 佛罗里达州 以上来自于百度翻译 以下为原文 I registered an Interrupt callback function with CyU3PRegisterUartCallback(). But I do not receive any Events there. The Callback-Function is never called. Do I have to enable UART Interrupt? If yes, how can i do it? Regards frw |
|
|
|
你好,
你可以设置为使用cyu3puartrxsetblockxfer API接收的字节数。你收到的字节后在UART的很多数,设置incyu3puartrxsetblockxfer,你将进入异步回调。我们有一个例子来证明同样的情况。如果你想得到相同的,请在www.cypress.com创建一个技术支持的情况下。 当做, 加亚特里 以上来自于百度翻译 以下为原文 Hi, You may set the number of bytes to be received using CyU3PUartRxSetBlockXfer API. Aftre you receive so many number of bytes in UART, as set in CyU3PUartRxSetBlockXfer, you will enter UART callback. We have an example for demonstrating the same. If you would like to get the same, please create a tech support case at www.cypress.com. Regards, Gayathri |
|
|
|
你好,
好,我现在接收中断,在设置Cyu3PurrxStxBaseBuffic(1)之后 在我的应用中,我使用两个DMA自动通道:一个从UART到UB-CDC批量EP,另一个反过来。我改变了我的应用程序使用中断回调来调用CYU3PDMACHANEL StReRAPUP(..)。现在我收到一个中断并发送字节。但是,UART接收到的一个字节总是在系统中出现,而只有当下一个字节写入UART时才会发送。例如,将“1234”暂停“5”到UART RX中,主机接收“123”暂停“4”。你知道我该怎么修理它吗?问候FRW 以上来自于百度翻译 以下为原文 Hi, OK, I receive Interrupts now, After setting CyU3PUartRxSetBlockTransfer( 1 ) In my application I use two DMA Auto channels: One from UART to the USB-CDC Bulk-EP and another one vice versa. I changed my Application to use the Interrupt callback to call CyU3PDmaChannelSetWrapUp(..). Now I receive an interrupt and send the Bytes. BUT: One byte received by the UART always stucks in the System and it is only sent, when the next byte is written into the UART. E.g. sending "1234" pause "5" into the UART RX, the Host receives "123" pause "4". Any Idea how I can Fix it? Regards frw |
|
|
|
我一直有同样的问题,我有一些代码,但我不知道它是多么可靠。我还在测试。
我所做的是在DMA模式中设置UART,并设置中断回调函数,如果没有接收到足够的数据来触发DMACALBACK函数,则使用线程管理数据。 在中断回调函数中,我检查它是否被调用,因为RX完成事件,如果是这样,我递增计数器并设置一个事件。在我的线程中,它一直在等待这个事件。一旦线程被事件唤醒,我就清除事件。然后我有一个do-while循环,首先保存当前中断计数,然后再睡一会儿(一定量的时间让更多的字节被接收UART。这可能取决于你的波特率。)当它醒来睡检查是否当前的中断计数为睡觉前一样。如果是一样的话,没有更多的数据来了,我叫收卷功能。如果不是在部分退出如果中断计数是一个超时计数后零或。所以我只在回路中等待四次。在dmacallback功能我清除中断计数器和做我想做的任何事情的数据。这样,如果dmacallback发生我睡觉的时候我会看看有没有更多的数据回到等待事件。 整个想法是,如果有新的数据到达但不足以引发dmacallback然后我叫收卷功能,使dmacallback函数的调用过程,到了数据。如果DMAcallback被称为在等待更多的数据,那么一切的工作,我们不需要打电话给收卷功能。如果更多的数据到达后收卷被称为事件会使螺纹会从头开始再做一遍。 就像我说的是工作,但有人告诉我,它并不总是可靠的。如果有人想出一些新点子会听到他们的伟大。 谢谢, 加里 以上来自于百度翻译 以下为原文 I have been having the same issue and I have some code that is working but I'm not sure how reliable it is. I am still testing. What I did was to setup the UART in DMA mode and also setup an interrupt callback function and use a thread to manage the data if I do not receive enough data for the DMA callback function to be triggered. In the interrupt callback function I check if it is being called because of an RX DONE event and if so I increment a counter and set an event. In my thread it is waiting forever on this event. As soon as the thread wakes up by the event I clear the event. Then I have a do while loop that first saves the current interrupt count and then sleeps for a while (Some amount of time to allow more bytes to be received by the UART. This might depend on your baud rate.). When it wakes up from sleeping it checks if the current interrupt count is the same as it was before sleeping. If it is the same then no more data has arrived and I call the wrapup function. If not the while part quits if the interupt count is zero or after a timeout count. So I only wait for maybe four times in the loop. In the DMA callback function I clear the interrupt counter and do whatever I want with the data. This way if the DMA callback happens while I'm sleeping I will see there is no more data and go back to waiting for the event. The whole idea is that if some data arrives but it's not enough to trigger the DMA callback then I call the wrapup function to cause the DMA callback function to be called and process the data that has arrived. If the DMA callback gets called while waiting for more data then everything worked and we don't need to call the wrapup funciton. Also if more data arrives after the wrapup was called the event will get set so the thread will go back to the begining and do it again. Like I said it is working but I have been told that it's not always reliable. If someone comes up with some new ideas it would be great to hear about them. Thanks, Gary |
|
|
|
尝试从“超速设备设计示例”的例子中,在CH.4示例3中,其中FX3从UART信道上从PC获得简单命令,它应该有针对每个字节调用的UART回调,而CYU3PUARTRXSETBASTROUNT传输(1)不发生!
此外,像前面提到的海报一样,在接收字符方面有一些延迟(从HTerm或CeleTealEnter),甚至丢失一些-我发送“SET200 R”,我得到回声“ET200”或“T200”。 我知道FX3的主要目的是为了高速USB 3通信,所以可能在UART DMA信道上修复这样的问题对于CyPress团队来说不是很高的PRIO;然而,开发FW APPLL。对于这种FX3芯片,尤其是上面的书,需要这样的“后门通道”进行调试,所以…请问我们何时以及怎样才能从柏树那里得到修复? 谢谢您。 以上来自于百度翻译 以下为原文 Trying the examples from the book "SuperSpeed Device - Design by Example", at ch.4 Example 3, where the FX3 is getting simple commands from PC over UART channel, it is supposed to have the uart callback called for each byte, with CyU3PUartRxSetBlockTransfer(1) - not happening ! Also, like previous posters mentioned, there are some delays in receiving characters (from HTerm or ClearTerminal) or even missing some - I send "set200r" and I get echoed "et200" or "t200". I know the main purpose of FX3 is for high-speed USB 3.0 communication, so probably fixing such problem on the UART DMA channel is not high prio for Cypress team; however, developing FW appl. for this FX3 chip, especially following the above book, needs such "back-door channel" for debugging, so.... when and how can we expect a fix from Cypress, please ? Thank you. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2098 浏览 1 评论
1845 浏览 1 评论
3664 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1782 浏览 6 评论
1532 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
556浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
409浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
433浏览 2评论
379浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
905浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-18 13:46 , Processed in 1.086920 second(s), Total 59, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号