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.

PROCESSOR-SDK-AM65X: MCAN configuration

Part Number: PROCESSOR-SDK-AM65X

I have followed the underlying steps but still unable to transmit/receive data on the MCAN. Please point out where i have made a mistake or have i missed any step here?

1. Took the contents of the .dtsi file generated from the PINMUX Tool and pasted the contents in the respective .dts files in the Kernel (arch/arm64/boot/dts/ti/k3-am654-base-board.dts and  k3-am654-idk.dtso )and the U-Boot folders(arch/arm/dts/k3-am654-base-board.dts and arch/arm/dts/k3-am654-r5-base-board.dts).

2. Compiled the U-BOOT through SDK.

3. Build the kernel, created the Image file, build the modules and installed them.

4. Installed the kernel with the rootFS.

5. Copied the rootFS  and the .dtb file to the to SD card

6. Then booted the kernel from the SD Card

After this I connected a CAN tool to the EVM and tried to send data using the following set of commands:

i. ip link set can0 type can bitrate 1000000

ii. ip link set can0 up

iii. cansend can0 123#DEADBEEF

I did not get any data on the other end. Where am i making the mistake?

Also, there is no LED glowing on the EVM Daughter Board. How can we be sure that the board is powered?

  • Hello,

    Are you working with the AM65x EVM as found here:

    http://www.ti.com/tool/TMDX654GPEVM

    What version of the SDK are you working with?

    Have you tried using the pre-built images that come with the SDK? You can do this easily by running the sdcard-create.sh script that is located in the /bin folder of the SDK. This would be a great starting point to get CAN working in your set up.

    Thank you.

  • hi , We are working on the same project ....

    the evm is am65xx - and the sdk version is 06.00.00.07 

  • Hi,

    Thanks for your response. Yes we are working on the same EVM.

    Yes we have tried the prebuilt images also. can0. We got the following response when we tried to send a message using cansend, we got the following response(Screenshot attached). Does this response confirm that the CAN is working properly? As we are not able to see any response on the other end so we are unable to conclude the same.

    We are getting the same response for the configuration we did.

    Thanks and Regards

  • Hi, 

    Could please post the results of "ip -details link show can0"?

    Could you please describe your test setup?

    Best Regards,

    Schuyler

  • Hello,

    Please find the command and the response below:

    ip -s -d link show can0
    3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 10
        link/can  promiscuity 0 minmtu 0 maxmtu 0 
        can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
              bitrate 500000 sample-point 0.875 
              tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1
              m_can: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..512 brp-inc 1
              m_can: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..32 dbrp-inc 1
              clock 80000000
              re-started bus-errors arbit-lost error-warn error-pass bus-off
              0          0          0          0          0          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 
        RX: bytes  packets  errors  dropped overrun mcast   
        601179     104539   0       0       0       0       
        TX: bytes  packets  errors  dropped carrier collsns 
        105        104539   0       0       0       0      

  • Hi,

    The output from the show command does not indicate the interface is seeing any errors. Do you have a CAN bus analyzer? What is connected to the other end? Could you attach a picture of how you are connecting the CAN cables?

    Best Regards,

    Schuyler

  • Hi, not sure if this matters, but noticed that the command above shows a bitrate of 500000.   It looks like you tried to set up a bitrate of 1000000 earlier.

    Hoping that Schuyler can weigh in on this.  Seems confusing to me, and I am also trying to learn about CAN usage on the AM65x.

    Good luck!

    Scott

  • Yes. I tried with a Canalyzer. Actually there was a mistake in the canalyzer configuration. The AM65x configuration was working fine.

  • I have been trying for different bit rates. Finally it is working.

    But I am unable to find sample applications for mcan. How do i find the APIs to configure, read-write and do other operations in CAN.

  • Hi,

    MCAN is the name of the ip module integrated into the AM65x, it is not a standard to my knowledge. The MCAN IP supports both DCAN and CAN FD, based on how the interface is initialized with the ip set command is the mode the interface operates in. 

    This first link is to the Open Source code for the CANUTILS project. Looking at cansend.c shows how to access the CAN interface from source code.

    Link to canutils source tree

    Link to the TI Processors SDK Linux CAN users guide

    The SDK documentation link starts with describing the MCAN module and is followed by command line examples.

    Best Regards,

    Schuyler