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.

AM625: MCAN0 Module configuration of AM625 development board.

Part Number: AM625

Hi Team,

We have started working on the MCAN module configuration for the AM625 Development Board.

Modified the below parameters in the device tree file.

1. Enabled the MCAN0 instance in the main domain (main_mcan0).

    => To enable the can0 interface

2. GPIO Pins used:

    C15 --> MCAN0_TX_GPIO1_24, Base Address 0x01d8

    E15 --> MCAN0_RX_GPIO1_25, Base Address 0x01dc

3. We are trying to check for the loopback functionality of MCAN

Please suggest the changes required to enable the MCAN feature on AM625 development board.

Thanks.

  • Hi,

    We are testing the commands listed below:

    1. ifconfig => Able to see can0 interface

    2. ip link set can0 type can bitrate 125000 => To Set the bitrate

    after executing the above command facing the below error:

     ip link set can0 type can bitrate 125000
    ip: either "dev" is duplicate, or "type" is garbage

    3.  ip link set can0 up => To bring up can interface


    [ 3455.218126] m_can_platform 20701000.can can0: bit-timing not yet defined
    [ 3455.224850] m_can_platform 20701000.can can0: failed to open can device
    ip: SIOCSIFFLAGS: Invalid argument

    While attempting to bring up can interface, getting the print as "bit-timing not yet defined".

    4.  dmesg | grep can
    [    1.738129] pinctrl-single f4000.pinctrl: pin PIN122 already requested by 20010000.i2c; cannot claim for 2820000.serial
    [    5.075497] m_can_platform 20701000.can: m_can device registered (irq=36, version=32)
    [   13.148891] wlan: SCAN COMPLETED: scanned AP count=14
    [ 2780.996483] m_can_platform 20701000.can can0: bit-timing not yet defined
    [ 2781.003206] m_can_platform 20701000.can can0: failed to open can device
    [ 3292.626931] can: controller area network core
    [ 3292.642588] can: raw protocol
    [ 3455.218126] m_can_platform 20701000.can can0: bit-timing not yet defined
    [ 3455.224850] m_can_platform 20701000.can can0: failed to open can device

    I would appreciate your advice on this particular matter.

    Thanks.

  • Hi Lakshmi,

    Have you applied the DT overlay file: k3-am62x-sk-mcan.dtbo ?

    Regards,
    Aparna



  • In our Source code "k3-am62x-sk-mcan.dtbois not available.

    could you please guide, how we can get the dts file for mcan ?

    Documents Referred:

    1. AM62x SK EVM User's Guide

    2. AM62x datasheet.

    Link referred to download the source code:

    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/Overview_Building_the_SDK.html

    Thanks.

  • Hi,

    The overlay file should be present in boot/dtb/ti folder in the root partition of the SD card, if AM62 .wic image is flashed into the SD card.
    The procedure to apply this overlay file for MCAN functionality is also explained in the link shared in my previous reply.
    Please go through the document: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/How_to_Guides/Target/How_to_test_MCAN_on_AM62x.html#enable-device-tree-overlay

    Regards,
    Aparna

  • Hi Lakshmi,

    The dtb file is there in your SDK. Check your SD card rootfs-->boot-->dtb-->ti then set for overlay in uEnv.txt file only(boot --> uEnv.txt). The Linux command is not working. Afterward, check your program running.

    Below steps follow 

    1. First check CAN H and CAN L two pins are the same voltage (minimum 1.5v to 3v). Different voltages mean your module can burn. Change can module.

    2. On the transmitting side which controller using?

    I attached screenshot below:

    How to add dt-overlay file attached below:

    commend : name_overlays=ti/k3-am625-sk-mcan.dtbo it's working fine

    =>ip link set can0 type can bitrate 500000
    =>ip link set can0 up
    =>candump can0

    Regards,

    Veerapandiyan V

  • Hi Aparna,

    Can you please provide the dts file which has mcan support for SK-AM625 ?

    Thanks. 

  • Hi Lakshmi,

    You installed the processor SDK which Version tell me. Then which MCU+SDK installed?

    Regards,

    Veerapandiyan

  • Hi Lakshmi,

    Quoting from earlier shared documentation "Since AM62 SKs do not have on-board CAN transceivers, there are no transceiver nodes in their respective DTS files."

    You will need to download and flash the 9.1 AM62x wic image, and the overlay file must be present in rootfs partition. Apply this overlay file in U-boot prompt in order to get MCAN support.

    Please follow the documentation carefully and let me know if you face any issues.

    Regards,
    Aparna

  • Hi Veerapandiyan,

    1. After executing "ifconfig -a" command able to see the can0 interface, but without hardware address.

    root@am62xx-evm:~# ifconfig -a
    can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
              NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:36

    2. How we can configure can0 with hardware address ?

    Is it possible with iproute2 instead of ip link. If yes, kindly provide the iproute2 package installation steps for AM625.

    Thanks.

  • Lakshmi

    Is it possible with iproute2 instead of ip link. If yes, kindly provide the iproute2 package installation steps for AM625.

    I don't think the iproute2 package is available in the Yocto filesystem. Any specific reason for you which you need this?

    Can you please provide the dts file which has mcan support for SK-AM625 ?

    You need the additional device tree overlay.

    If you don't see one in your SD card, use the one attached. Also, make sure your u-boot environment is set to include this overlay using the uenv.txt or by updating the environment setting as mentioned below.

    Please share your u-boot logs as well, the logs will allow us to do a sanity check if the overlay was applied or not.

    If you want to enable internal loopback, you should append "loopback on" in your command when setting bitrate.

    Refer the FAQ here - https://e2e.ti.com/support/processors-group/processors/f/processors-forum/922168/faq-tda4vm-how-can-i-use-can-on-linux

    Regards

    Karan

  • Hi Lakshmi,

    1. After executing "ifconfig -a" command able to see the can0 interface, but without hardware address.

    root@am62xx-evm:~# ifconfig -a
    can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
              NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:36

    The same error I got it please change the uEnv.txt file: remove only ti.

    Command: name_overlays=k3-am625-sk-mcan.dtbo This command is working fine.

    After you check show the can address.

    Regards,

    Veerapandiyan V