完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我的设置的一些细节:PIC32 MX2170F256D被用于USB主机模式,在2.03b的谐波(虽然以前同样在2.01b上看到过),使用动态USB FS主机驱动来自OrthyUSB始终是供电的,而VBuSyon引脚用于其他目的。时间的长短,能够对CDC设备进行良好的收发。然而,在从CDC设备到PIC32的持续一个单向高流量负载之后,PIC32上的USB外围设备锁定,并且拒绝通过USB发送或接收任何更多的业务。PIC32行为的其余部分保持正常。一旦在这种模式下,PIC32仍然可以检测是否删除/重新插入USB设备,但无法与任何设备进行通信。(这意味着它不能正确地识别我插入的任何设备,即使它检测到我插入它……)我比较了一组和谐的数据结构和工作和非工作之间的外围寄存器,我注意到的唯一一件事就是U1CON的TokCube位被困在1点。R锁定(即使我删除和重新插入USB设备,仍然会被卡住)。我搜索了论坛,我发现TokCube卡的唯一引用是BDT管理不当或乒乓缓存机制错误引起的问题。在我的系统中,和谐正在管理这些,所以我怀疑我正在追踪和谐代码中的bug……有人知道会导致Tok忙碌标志被设置和永远不清除的任何其他原因吗?作为一个远景,有没有其他人发现这个错误在和谐USB主机代码?最后,是否有一个特定的寄存器,如果我即时检测到它,我可能会尝试在USB上颠簸来解决这个问题。显然,我宁愿找到并修复根本原因,但我们的应用程序的细节可以处理一个小嗝每隔几分钟,如果这是唯一的办法绕过它。
以上来自于百度翻译 以下为原文 Some specifics of my setup:
Once in this mode, the PIC32 can still detect if I remove/reinsert a USB device, but is unable to communicate with any devices. (Which means it can't properly identify any device I plug in even though it detects me inserting it...) I compared a bunch of Harmony data structures and peripheral registers between working and non-working, and the only concerning thing I noticed is that the TOKBUSY bit of U1CON is stuck at 1 after the lockup (and remains stuck even if I remove and reinsert the USB device). I searched the forums and the only references I found to TOKBUSY being stuck were issues caused by BDT mismanagement or mistakes with the ping-pong buffer mechanism. In my system Harmony is managing those, so I am suspicious that I'm chasing a bug in Harmony code... Is anyone aware of any other causes that would lead to the TOKBUSY flag being set and never cleared? As a long shot, has anyone else found this bug in the Harmony USB host code? And, finally, is there a particular register I might try bumping on the USB to workaround this issue if I detect it on the fly? Obviously, I would rather find and fix the root cause, but the particulars of our application can deal with a small hiccup every few minutes if that's the only way to get around it. |
|
相关推荐
2个回答
|
|
所以,更多的提示和信息……在缓冲区管理周围的竞争条件失败,我不使用线程,所以我尝试尽可能禁用系统上的中断。和谐的USB主机驱动程序显然不是要在没有中断的情况下运行,因为MHC删除了所有的USB启动代码。即使我修复了这一点,USB驱动程序仍然立即锁定。在中断模式下留下USB驱动程序,但禁用所有其他中断并没有解决这个问题。一般来说,我还发现,一旦我使系统处于卡住状态,我仍然在USB上获得SOF中断,但我永远不能启动新的传输请求。这是有意义的,如果硬件永久地报告自己是忙碌的……有没有其他人在这个PIC上面对这个Tok忙碌锁定?我不在乎它是否和谐,我只想了解更多的情况,特别是什么可以导致它。是不是试图使用一个仍然被标记在先前循环中使用的缓冲器?是不是在失败的转会后,做了一个缓冲的乒乓球?是不是因为失败后的乒乓球?任何提示可以帮助我简化我的测试用例,因为我只能在过度传输期间创建这个失败,这使得很难确定特定的动作导致了它。如果我想出来,我会很高兴地在这个线程中设置一个补丁2.03b…
以上来自于百度翻译 以下为原文 So, some more hints and info... The failure reeks of a race condition around buffer management, and I'm not using threads, so I tried disabling interrupts on as much of the system as possible. The Harmony USB HOST driver apparently isn't meant to function without interrupts as MHC removed all the USB startup code when I configured it that way. Even once I fixed that, the USB driver still locked up immediately. Leaving USB driver in interrupt mode but disabling all the other interrupts didn't fix the issue. In general, I've also discovered that once I get the system in the stuck state, I'm still getting SOF interrupts on the USB, but I can never start a new transmission request. That makes sense if the hardware is perpetually reporting itself as busy... Is there anyone else out there that has faced this TOKBUSY lockup on a PIC? I don't care if it was in Harmony or not, I just want to understand more about what circumstances in particular can lead to it. Is it from trying to use a buffer that is still marked in use from the prior cycle? Is it from doing a buffer ping-pong after a failed transfer? Is it from NOT doing a ping-pong after a failed transfer? Any hints that could help me simplify my test case, since I can only create this failure during excessive transfers which makes it hard to nail down which particular action caused it. If I figure this out, I will happily put a patch for Harmony 2.03b in this thread... |
|
|
|
我已经证明了这是一个和谐的错误。当每个传输完成时,和声更新一个本地变量来跟踪乒乓球。我认为它只能在一次启动一次传输的情况下工作,但由于某种原因,我的系统开始两次传输,而不是之前的第一次完成,因此使用相同的乒乓缓冲器进行两次传输。关于这个线程在和谐子论坛。
以上来自于百度翻译 以下为原文 I've proven to myself it's a Harmony bug. Harmony updates a local variable to keep track of ping-pong as each transfer finishes. I would assume it's supposed to work by only ever starting one transfer at a time, but for some reason my system is starting two transfers back-to-back without the prior one finishing first, and is thus using the same ping-pong buffer for two transfers. I'll be continuing my discussion of this mess over on this thread in the Harmony sub-forum. |
|
|
|
只有小组成员才能发言,加入小组>>
5153 浏览 9 评论
1995 浏览 8 评论
1924 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3167 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2221 浏览 5 评论
718浏览 1评论
604浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
489浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
618浏览 0评论
516浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-16 21:28 , Processed in 0.993448 second(s), Total 49, Slave 42 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号