Skip to content

Bit Rate Switch on CANFD  #2

@rolfkff

Description

@rolfkff

I am trying to get two RasPis with a CAN FD shield (MCP2517FD) to communicate via CAN FD. It actually works fine, but as soon as I set the BRS to TRUE, weird things happen and the messages are not sent out properly.

If I send messages without the BRS active I receive:

pi@raspberrypi:~/Desktop $ python receive.py 
CAN Tx test
Bring up CAN0....
Ready
 1585041201.788182 1 0 123 8 1 2 3 4 5 6 7 8 
 1585041201.808952 1 0 123 8 1 2 3 4 5 6 7 8 
 1585041201.830066 1 0 123 8 1 2 3 4 5 6 7 8 
 1585041201.851458 1 0 123 8 1 2 3 4 5 6 7 8 
 1585041201.872531 1 0 123 8 1 2 3 4 5 6 7 8 
 1585041201.893586 1 0 123 8 1 2 3 4 5 6 7 8 

Everythings fine so far.
Now I send the same messages but with the BRS set to True:

CAN Tx test
Bring up CAN0....
Ready
 1585042868.352613 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.372650 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.372807 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.372949 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.373283 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.393287 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.393603 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.414106 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.414431 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.434750 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.435073 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.455482 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.455801 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.476293 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.476358 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.476461 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.476531 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.476863 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.497091 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.497158 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.497273 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.497595 1 1 123 8 1 2 3 4 5 6 7 8 
 1585042868.517904 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518014 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518133 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518226 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518320 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518439 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518558 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518678 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518815 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518870 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.518991 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.519087 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.519267 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.519425 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.519550 0 0 8 8 0 0 0 0 0 0 0 0 
 1585042868.519683 0 0 8 8 0 0 0 0 0 0 0 0 

The result is different most of the times. I am sending 16 messages but only receive some of them (always a different number). Furthermore, if I send more messages from the same RasPi, I am getting the following error on the sending RasPi:


Traceback (most recent call last):
  File "send.py", line 32, in <module>
    bus.send(msg)
  File "/home/pi/.local/lib/python2.7/site-packages/can/interfaces/socketcan/socketcan.py", line 626, in send
    sent = self._send_once(data, msg.channel)
  File "/home/pi/.local/lib/python2.7/site-packages/can/interfaces/socketcan/socketcan.py", line 649, in _send_once
    raise can.CanError("Failed to transmit: %s" % exc)
can.CanError: Failed to transmit: [Errno 105] No buffer space available


Sometimes the RasPi freezes and I have to shut him down.

The bitrates and samplepoints of both configurations are the same.

Any ideas on how to get this running properly while the BRS is set or why this is happening?

Thank you very much in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions