Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

CAN-FD communication driver

macieksz
2022-08-22
2022-12-22
  • macieksz

    macieksz - 2022-08-22

    We have Raspberry PI with the MCP2518FD chip to connect with CAN-FD devices.
    We already know that CodeSys doesn't support CAN-FD natively.

    Linux System support this chip in kernel, CAN linux interface is visible.
    We can operate with CAN-FD devices using cansend and canread commands.
    We can also create own application using socketcan linux library, and averything works fine.

    We need to pass CAN-FD frames TO and FROM CodeSys with about 1kHz frequency and low latency.
    What is the best option to make this project as good as possible?

    a) Try to read CAN-FD frames in external CPP application using socketcan and pass it to CodeSys using udp/serial/shared memory?
    b) Somehow read frames directly in the CodeSys by creating own module?
    c) use C extension module to get communication with CanFD using socketcan?
    d) write MCP2518FD driver directly in CodeSys using SPI?
    e) other?

     
  • DavidBo - 2022-08-22

    If it is raspberry pi why not just modify
    /opt/codesys/scripts
    so it sets up with
    ip link set DEVICE type can fd on
    maybe CODESYS will work with that? I don't know but give it a try

     
  • eeyrsja - 2022-12-22

    Hello @macieksz, did you find a solution to your requirement? I'd also like to get a CAN-FD operational on Raspberry Pi with CODESYS. Do you have any suggestions? Thanks.

     
    • macieksz

      macieksz - 2022-12-22

      Unsuccessful. We use Can 2.0b

       
      • eeyrsja - 2022-12-22

        Many thanks for the response. I had come to a similar conclusion.

         
      • eeyrsja - 2022-12-22
         

        Last edit: eeyrsja 2022-12-22

Log in to post a comment.