完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在开发一个CANopen主机,它将管理一批CANopen奴隶(一个或多个)。不管协议的其他细节,它使用一个主/多从拓扑,其中主机可以根据SIP中的地址发送命令,例如重置或启动奴隶。据我所知,在一个节点中,一个节点发送的消息必须被至少另一个节点所确认,在某些情况下,我看到了主机的TX-FIFO,它的消息充满了待发送,显然是因为没有接收到ACK,或者看起来是什么样子。如果我在AutoBoopRead模式下配置一个奴隶,因为它通常需要分析几个数据包来检测波特率,如果总线中只有一个在TX FIFO被阻塞时,就不可能执行检测。因此,为了防止主从当奴隶DOE被阻塞。SN不响应,我的想法是使用1消息TX FIFO,并中止当前转移,如果我检测到超时。当这种情况发生时,我认为我应该遵循的步骤是:(PIC32 MX):1。设置CXCON.ABAT2。等待,直到CXCON.ABAT为0(传输已被中止)3。设置CXFIFON。等到CXFIFOCON.FREET是0(FIFO已经被复位)使用1消息FIFO将很容易处理所有指针的东西,并允许我重置FIFO,而不必注意哪个从节点是不正确工作的,或者有ALL的节点发生了什么。阿迪排队等候留言。我知道,这需要一些额外的高层控制,但这不是问题。问题是:当我说FIFO不会因为没有接收ACK而消耗数据包时,我是对的吗?这是中止转帐的正确方法吗?-发送消息时会发生什么?它会永远在公共汽车上吗?当做
以上来自于百度翻译 以下为原文 Hi I'm developing a CANopen master, which is going to manage a number of CANopen slaves (one or more). Regardless of other details of the protocol, it uses a master / multislave topology, where the master can send commands such us RESET or START to slaves based on their addresses, encoded in the SID. As far as I know, in CAN bus a message sent by a node must be acknowledged by at least another node, and I've seen in some cases the TX FIFO of the master full of messages pending to be sent, apparently because no ACK has been received, or that's what it looks like. Another scenario similar to this happens if I configure a slave in autobaudrate mode, because it usually needs to analyse several packets so as to detect the baudrate, and if there's just one in the bus while the TX FIFO blocked, no detection can be performed. So, in order to prevent the master from getting blocked when a slave doesn't respond, my idea is to use a 1-message TX FIFO and abort the current transfer if I detect a timeout. When this happens, the steps I think I should follow are (PIC32MX): 1. Set CxCON.ABAT 2. Wait until CxCON.ABAT is 0 (the transfer has been aborted) 3. Set CxFIFOCONy.FRESET 4. Wait until CxFIFOCONy.FRESET is 0 (the FIFO has been resetted) Using a 1-message FIFO would make easy to handle all the pointer stuff and would allow me to reset the FIFO without having to pay attention to which slave node is the one not working properly or what happens with the nodes that have already enqueued messages. This would need some extra control from upper layers, I know, but that's not a problem. And the questions: - Am I right when I say the FIFO is not consuming packets as a consequence of not receiving an ACK? - Is this the right way to abort a transfer? - What is expected to happen with the message being sent? is it going to be there in the bus "forever"? Regards |
|
相关推荐
12个回答
|
|
|
|
|
|
我还没有在这个芯片上使用CAN,但是如果传输节点在MSID中赢得仲裁,如果它是唯一的传输,或者如果它在MSID中有第一个零位,那么它就完成传输。2)如果没有ACK,它会间歇地重试(在HW层)。3)在一些数字之后。在未接收到的传输中,它到达总线光,然后总线重发错误状态,并最终脱离总线。4)如果你发送到AutoBoD,一个包将被芯片,直到接收者同步并ACK’.5)* * * *只有当收件人喜欢它的过滤器中的MSID时才会发生ACK。…因此,让每个人都有一个过滤器接受AutoBoD MSID,然后有任何其他过滤器。换句话说,用低固定波特率设置系统并证明它。然后加快速度,了解你的拓扑限制。找到一个CAN计算器,以确保您有最好的位定时为您的电缆长度等,然后,你应该弄乱自动驾驶和设备来来去去。
以上来自于百度翻译 以下为原文 I have not used the CAN on this chip yet, but 1) if the transmitting node wins the arbitration in the MSID, which it will if it is the only transmitting or if it has the first zero bit in the MSID, it finishes transmission. 2) if no on acks, it retries (at hw layer) intermittently. 3) After some number of un ack'ed transmissions, it reaches bus light and then bus heavy error states and eventually takes itself off the bus. 4) If you are sending to autobaud, that one packet will chip until a recipient syncs up and ack's. 5) I *think* an ack only happens if a recipient likes that msid in its filters... so make everyone have a filter that accepts the autobaud msid and then have whatever other filters. That said, set the system up with a low fixed baud rate and prove that out. Then speed it up to understand your topology limits. Find a CAN calculator to make sure you have the best bit timing for your cable lengths etc. Only then should you mess with autobauding and with devices coming and going. |
|
|
|
根据这一点,它看起来像主机正在尝试发送相同的数据包,并最终与总线断开连接。这将与TX FIFO不断增加的事实相一致,直到它已经满了(我在32个消息FIFO中注意到这一点,当我在FIFO未满的时候插入消息,我可以看到FIFO,也不完全没有空一段时间,但是包不在。这里的问题是如何完全重置CAN控制器,以便在检测到这个问题时从头开始。我可以看出从正常操作模式切换到禁用和正常操作再也不出窍门。我会试着把这个和其他FIFO相关的动作结合起来,看看我是否能把巴士带回来。
以上来自于百度翻译 以下为原文 According to this, it looks like the master is retrying to send the same packet and eventually it gets disconnected from the bus. This would be coherent with the fact that the TX FIFO keeps getting more and more populated until it's full (I noticed this in a 32-message FIFO, when I was inserting messages while the FIFO wasn't full, and I could see the FIFO nor full neither empty for some time, but as the packets weren't being sent it ended up getting full). The question here would be how to fully reset the CAN controller in order to start from scratch when this problem is detected. I can tell switching from normal operation mode to disable and to normal operation again doesn't make the trick. I'll try to combine this with other FIFO-related actions to see whether I can bring the bus back to life or not. Regards |
|
|
|
真正的问题是如何阻止问题的发生。同样,YO也有一些并发症,比如自动备份,应该先去掉测试基本物理层和节点过滤器等等。只需重置CAN,重新启动,固件就等同于精神错乱的定义。是的,一旦你知道它通常是有效的,那么重置在异常错误的情况下是有意义的。
以上来自于百度翻译 以下为原文 really the problem is how to stop the problem from happening. Again, yo have some complications like autobauding that should be gotten rid of first to test the basic physical layer and node filters, etc. Just resetting the CAN and starting over is the firmware equivalent of the definition of insanity - doing the same thing over and over but expecting a different result. yes, once you know it usually works, then resetting makes sense in the anomalous error case. |
|
|
|
一个做AutoBod检测的奴隶必须是只听模式。在总线上必须至少有两个CAN节点正常运行。自检奴隶可以在总线上侦听(但不参与)消息,直到收到有效消息,并确定它已经选择正确的B。澳元汇率。只有这样,它才能在总线上正常运行。
以上来自于百度翻译 以下为原文 A slave doing autobaud detection must be in listen only mode. There must be at least two other CAN nodes operating normally on the bus. The autobaud'ing slave can then listen to (but plays no part in) the messages on the bus until it receives a valid message and determines it has chosen the correct baud rate. Only then can it start interacting as normal on the bus. |
|
|
|
主人本身是唯一的一个发送数据到总线上的奴隶(假设只有一个)通过侦听主包来检测波特率吗?这是否真的可能基于CAN硬件层,它将等待一个不接收的ACK?如果答案是否定的,我将不得不设置一个众所周知的奴隶速度。另一方面,我也想知道如何摆脱实时奴隶故障或断开。也就是说,波特率问题被解决了(也许通过禁用自动波特率),并且出于某种原因,奴隶不会在一段时间内做出反应。检测问题很容易,但我想我试着遵循我在第一篇文章中提到的步骤来中止当前的传输,我不能清理TXFIFO。所以,这个序列行吗?我怎样才能确定FIFO已经回到1平方?我记得尝试过这个序列,但是TXWORD标志没有设置,所以FIFO仍然有一些信息悬而未决。
以上来自于百度翻译 以下为原文 How about the master itself being the only one sending data to the bus in order for the slave (assuming there's just one) to detect the baudrate by listening to the master packets? Is this really possible based on the CAN hardware layer which is going to be waiting for an ACK that's not going to receive? If the answer is no, I'll have to set a well known slave speed. On the other hand, I would also like to know how to get rid of real time slave malfunctions or disconnections. That is, let's say the baudrate problem is solved (maybe by disabling the auto baudrate) and for some reason a slave doesn't respond for some time. Detecting the problem is easy, but I think I tried to follow the steps I mentioned in the first post to abort the current transfer and I couldn't clean the TX FIFO. So, is this sequence ok? How can I make sure the FIFO has gone back to square 1? I remember having tried this sequence but the TXEMPTY flag wasn't set, so the FIFO had still some message pending. Regards |
|
|
|
重读我写的东西。你必须至少有两个工作模块。如果你只有两个,你为什么还要和罐头一起打搅?一个故障可能会使整个总线下降,然后你就被卡住了。如果你有至少两个奴隶,那么其中一个奴隶可以被一个新的奴隶所取代,它可以通过听主人和另一个奴隶之间的交通来进行自动侦测。一旦确定了正确的波特率,新的奴隶就可以宣布自己。如何做到这一点以及如何检测失败的奴隶是你选择的协议或应用程序的一部分。
以上来自于百度翻译 以下为原文 re-read what I wrote. You must have *at least* two working modules. If you only have two, why are you even bothering with CAN? A malfunction could take the whole bus down, then you are stuck. If you have at least two slaves then one of the slaves can be replaced with a new slave that can do autobaud detection by listening to the traffic between the master and the other slave. Once the correct baud rate is determined the new slave can announce itself. How it does that and how you detect the failed slave is something for your chosen protocol or application. |
|
|
|
你必须至少有两个工作模块。如果你只有两个,你为什么还要和罐头一起打搅?CAN是两个处理器之间的硬件层FIFO,允许缓冲、异步传输小数据消息。为了这个目的,我在一些电路板上使用“无收发器”。
以上来自于百度翻译 以下为原文 Crossland: You must have *at least* two working modules. If you only have two, why are you even bothering with CAN?CAN is a hardware layer FIFO between two processors allowing buffered, async transfer of small data messages. I use it 'transceiverless' on some boards just for this purpose. |
|
|
|
|
|
|
|
然后,我会切换到固定的波特率,以防万一只有一个奴隶。但是,我已经检测到几次奴隶没有反应,FIFO在一个单一的奴隶配置满。这是我没想到会发生的事情,因为我正在与一个商业CANopen奴隶,但它经常发生。问题通常出现(随机)当我切换奴隶,并等待一段时间之前,切换主机。过了10分钟或15分钟,我向制造商支持团队发出了一个请求,他们给我发送了一个视频来模拟这个场景,他们的一个商业大师能够与奴隶沟通。所以,我会在监听模式下插上一个第三块板,看看到底发生了什么。这就是为什么我试图找出当节点出现故障时会发生什么。我相信这应该是从硕士的角度来看,我的测试场景,也就是说,不知何故没有接收到ACK。
以上来自于百度翻译 以下为原文 I'll switch to fixed baudrate then, just in case there's only one slave. However, I have detected a few times a slave not responding and the FIFO getting full in a single slave configuration. That's something I didn't expect to happen considering I'm communicating with a commercial CANopen slave, but it happens from time to time. The problem normally appears (randomly) when I switch the slave on and wait for some time before switching the master on. By some time I mean 10 or 15 minutes. I sent a request to the manufacturer support team, and they sent me a video simulating this scenario with one of their commercial masters being able to communicate with the slave. So, I'll plug a third board in listen mode to see what's really going on. That's why I was trying to find out what happens when there's a node malfunction. I believe this should be quite similar from the master's point of view to my test scenario, that is, the master somehow not receiving the ACK. Regards |
|
|
|
我忘记了奴隶是否会接受一个不符合接受过滤器的数据包…
以上来自于百度翻译 以下为原文 I forget if a slave will ack a packet that does not meet its acceptance filters... |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5184 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3179 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2230 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
511浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 15:24 , Processed in 1.869241 second(s), Total 99, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号