We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

MCP2515, can4linux, and SPI

  • I've laid out a custom expansion board that plugs in to an EXP DOC expansion port and has an MCP2515 (and physical layer chip) connected to the SPI bus (CS1).

    It looks like there has been a bit of work done with this combination... I'm new to using Linux with this sort of stuff though. I've got a few questions though... does anyone know:
    1- Is there a driver for the MCP2515 compiled into the Onion Kernel?
    2- Is can4linux compiled into the Kernel?
    3- Has anyone been able to get the MCP2515 up and going?

    It looks like someone did a bitbanged version of the driver, but I expect too much going on to rely on the timing with that version.


  • AFAIK Ramips/Mediateks SPI device is half duplex and it will not work without modifying the SPI driver or the MCP2515 kernel module to control a MCP2515. I've done a dirty hack for a Carambola1 board (RT5350) years ago. The Carambola1 uses non SPI flash (NAND) so the patch doesn't harm the flash access. But the Omega2 uses the SPI flash - bad luck.
    The other way would be using bitbanged SPI. It worked better than expected.

    As of today I'm using a PIC connected via ttyS1:
    The PIC is programmed inband from the Omega2.



  • Hi @Gerhard-Bertelsmann.

    Does the PIC approach support regular Canbus or does it also support CANFD?

    I'm looking to see what the best non-usb approach might be for adding can bus support to an Omega2 system. It looks like SPI is out due to the full duplex issue, serial via slcan looks like an option as does the PIC approach as well? For CANFD I was wondering if using a SAM21 micro as the controller could work but I'm not sure if slcan supports canfd (or if it has to).

    Or is the usb approach really the only way to go with canfd on the Omega2?


  • Hi Chris,

    the used PIC18F2xk80 only handle CAN2.0 and not CAN FD. If you want to use Omega2+ the USB port would be the best way to connect a MCU of your choice .

    The fastest way to get a working Linux CAN FD board is to use a SBC/CPU with CAN FD IP or something like BananaPi Zero with MCP2518/TCAN4550.



Log in to reply

Looks like your connection to Community was lost, please wait while we try to reconnect.