RPi3 + socketCAN + breakout board for 3 buses?


#1

Hi All,

I have purchased the M2 interface board w/breakout board. I understand there is a CAN controller for 2 high speed transceivers as well one for the SWCAN (GMLAN).

We have the need to connect a linux platform, such as the Pi to three CAN buses simultaneously. As a first step, I need to simply wire the Pi3 to the interface board and enable the various buses via socketCAN. Is this possible? Once wired up, is it a matter of setting the GPIO pin overlays?

I see the notes in Guide for the breakout board, but need to take it a step further to map between the breakout board and the Pi3 for the 3 buses.

A pin mapping would be great. Any suggestions or help very appreciated!


#2

Please be aware that the M2 only has the transceiver for the SWCAN bus. The other two canbus ports are taken from the Arduino Due board which has trancievers onboard. You would be better off getting a board made for the RPI or check out the project using a specialized conversion board with the pocket board.

https://docs.macchina.cc/pb_adapter/

This would be a much better option for you as the hardware already done but the software is what needs to be finished. I believe all three canbus ports should be available on that setup and is likely what you are looking for instead of trying to get a RPI to work.

Rodney


#3

Hi Rodney, I am not following you on the transceivers being part of the Arduino Due board. Per this link, they are on the interface board along with the CAN controllers.

Is there an example of using the Pi + the breakout board?


#4

I meant controllers…

The Arduino Due has 2 canbus controllers… They had to add a third to the board to do the SWCAN. The RPI does not have those controllers. The PocketBeagle does have those controllers on it too.

In order to use the RPI with the M2 you would have to build another board to sandwich between the M2 and the RPI with the two controllers you would need then you would have to build out drivers for those controllers which I believe are already in existance.

Check out the schematics here… It should become more obvious… Note the CAN0RX CAN0TX and CAN1RX CAN1TX. Those are built in to the Arduino and you don’t have on the RPI but IS on the BeagleBone.

Notice how the interface board has a very simple connection to the CPU board for the CAN0 and CAN1 where as for SWCAN there are a bunch of control lines.

They really should update the interface board sketch and show what the CPU has on it.

Check out the specifications for the Arduino Due and you will see it has 2 CANBUS controllers built in.

Rodney


#5

Ok, thanks, I see now “The M2 uses the 2 built-in CAN controllers found in the SAM3X”. The SAM3X being the Arduino Duo processor.


#6

Yes, the processor used on the Arduino Due and M2 has two built-in CAN modules. It thus needs only the transceivers to be able to use two CAN buses. Most other boards have either zero or one CAN module. So, you need to add the actual CAN interface modules for such devices.

At this point in time I’d recommend people use the MCP2517FD module. You can put as many as you need onto a board. They use SPI and will run up to 20MHz on SPI. The M2 interface board does not use CAN-FD capable transceivers but still the MCP2517FD is practically the same price as inferior CAN modules and is much more capable and future proof.