This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

[FAQ] TDA4VM: How can I use CAN on Linux

Expert 6200 points

Replies: 1

Views: 65

Part Number: TDA4VM

I see that on TDA4 there is no support for a CAN driver on Linux, is there a patch which I use to achieve basic functionallity?

  • We do not support CAN on Linux on TDA4, we recommend that CAN be controlled by R5F cores in respective domains i.e. MCU CANs being controlled by MCU R5 Fand MAIN CANs controlled by MAIN R5F.

    That being said, there is a patch you can apply in the device tree and do some basic level of tests on Linux with CAN. The attached patch is validated on SDK 6.02 and after applying the patch you can refer the instructions at https://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components/Kernel/Kernel_Drivers/MCAN.html#mcan to test the interface.

    To summarize the steps:

    #can0 corresponds to MAIN CAN0 (J27) and can1 corresponds to MAIN CAN2 (J28) on the TDA4 EVM
    #replace can0 with can1 in case you are using MAIN MCAN2
    #setup can0 in CAN FD mode with BRS enabled, 1Mbps of nominal bit rate and 5Mbps of data bit rate
    ip link set can0 type can bitrate 1000000 dbitrate 5000000 fd on
    ip link set can0 up
    
    #this should send a message on to your CAN emulator and you should be able to see this
    #send CAN FD frame
    cansend can0 113##2AAAAAAAA
    
    #send CAN FD frame with BRS
    cansend can0 143##1AAAAAAAA
    
    #after running the below command, send messages from the CAN emulator to the MCAN0 interface. You will see the messages on the EVM’s console. 
    candump can0

    Patch on top of SDK 6.02

    patch: /cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_dts_2D00_Add_2D00_MCAN0_2D00_and_2D00_MCAN2_2D00_support_2D00_in_2D00_linux.patch

    Regards,

    Karan

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.