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.

Linux/TDA2EVM5777: Using DCAN with Linux on A15

Part Number: TDA2EVM5777
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Linux

Hello,

I want to use both DCAN channels on my EVM5777 board with TDA2xx.

I have booted into linux on A15.

I want to use DCAN in my application on linux.

Does the linux for TDA2xx integrate a DCAN driver?

How can i use the DCAN through linux?

I have already tried out DCAN (once channel ) on SysBIOS. But not sure how it use it when booting into Linux.

Kinldy let me know.

Thanks and Regards,

Archit Adwant

  • Hi Archit,

    Please check the links in this post:
    e2e.ti.com/.../2554920

    Regards,
    Yordan
  • Thanks.

    This is helpful and has the required information for DCAN1. I am testing it.

    I also need to use DCAN2 on the vision board.

    The link says that only one CAN is supported.

    How to  use DCAN2 also on the EVM5777 board?

    Want to use it through the add-on vision application board.

    Also, i have two more questions about the board.

    1. I need one Analog output. Did not find any analog output on the board. What is the recommended way, if an analog output is requried?

    2. I want to connect the LCD to the LCD interface. I tried it, but did not get anything on the display. Did not find any information in the data sheet about connecting the LCD. Is there any such reference available? Also, is there any test application for the LCD?

    Kindly let me know.

    Thanks and Regards,

    Archit Adwant

  • Archit
    Can you clarify on the SDK version that you have been using

    For enabling an additional instance in Linux, you will have to replicate and add the entries for the second CAN instance in the device tree file. You can refer to the existing definition for first instance as reference.
    The basic module definitions for both instances are defined under arch/arm/boot/dts/dra7.dtsi
    From the EVM specific device tree file, need to select the pin mux configuration and mark the instance as enabled
    refer to :dcan1_pins_default , dcan1_pins_sleep and dcan1 definitions and replicate the same dcan2

    The driver will claim the pins specified as part of the device configuration - hence review for pin mux conflicts for the pins that you may choose.

    At board level, also review if additional configuration is necessary to select board level mux for CAN signals or transceiver connection
  • Hi Srirama,

    Thanks for the information.

    I am using Linux SDk for 3.05.00.00 for TDA2xx EVM5777 Vayu board.

    I will try out the above details and get back to you in case of any issues.

    Before starting the changes, i have one doubt.

    Even with Linux SDK, i believe that the other cores i.e Cortex M4 cores run the SysBIOS. I have tried CAN driver with SysBios ( for DCAN1). So, does the SysBIOS come with the CAN driver enabled for DCAN2 also?

    And can i invoke the SysBIOS driver, running on M4 from the linux on A15, using the links framework?

    Can this approach be an alternative to making the above changes?

    Kindly let me know.

    Thanks and Regards,

    Archit Adwant

  • Hi Shriram,

    I am trying to use DCAN1 on the above board on Linux.
    I do not get the utilities mentioned in the above link on the target.
    i.e. i do not get canconfig command on the target.
    Also, the /dev/... does not show any CAN driver..
    How do i confirm i CAN has been included in the build?

    Kinldy advise

    Thanks and Regards,

    Archit Adwant
  • Archit
    At runtime you can check the enabled kernel config options through
    #zcat /proc/config.gz

    For the canutils, can you confirm which filesystem image are you using?
  • Hi,

    I am using the following targetfs
    tisdk-rootfs-image-dra7xx-evm_vsdk_3_5.tar.xz

    I just checked the kernel config.
    CAN is configures as modules. is there any script to load them.
    the following is the CAN related configs.

    ---------------------------------------------------------
    # CONFIG_NET_EMATCH_CANID is not set

    CONFIG_CAN=m
    CONFIG_CAN_RAW=m
    CONFIG_CAN_BCM=m
    CONFIG_CAN_GW=m

    # CAN Device Drivers
    #
    # CONFIG_CAN_VCAN is not set
    # CONFIG_CAN_SLCAN is not set
    CONFIG_CAN_DEV=m
    CONFIG_CAN_CALC_BITTIMING=y
    # CONFIG_CAN_LEDS is not set
    # CONFIG_CAN_TI_HECC is not set
    # CONFIG_CAN_FLEXCAN is not set
    # CONFIG_CAN_GRCAN is not set
    # CONFIG_CAN_RCAR is not set
    # CONFIG_CAN_SJA1000 is not set
    CONFIG_CAN_C_CAN=m
    CONFIG_CAN_C_CAN_PLATFORM=m
    # CONFIG_CAN_C_CAN_PCI is not set
    CONFIG_CAN_M_CAN=m
    # CONFIG_CAN_CC770 is not set


    # CAN SPI interfaces
    #
    CONFIG_CAN_MCP251X=m

    ---------------------------------------------------------


    Kindly Advise
    Thanks.

    Archit
  • Hi
    You should be able to run modprobe to insert the required kernel modules ,if it has not been inserted automatically.
    Alternatively you should be able to modify the kernel config to make this a kernel builtin if need be
  • Hi,


    I have the can modules loaded.
    Now if it try to bring up the can interface i get the following error.

    root@dra7xx-evm:/sbin# ./ip link set can0 type can bitrate 125000
    ip: either "dev" is duplicate, or "type" is garbage
    root@dra7xx-evm:/sbin#

    I there a better targetfs which has a updated version of the 'ip' program.
    I browsed a bit and came to know that this is a problem due to a older version of 'ip'.

    And advise please.

    Thanks

    Archit
  • Hi,

    Requesting support on this please.
    I am unable to use CAN without any utilities. ( the CAN Units is not there, and the IP program is also not working for CAN)
    Is there any quick way to get the CAN interface up and working?

    Thanks in advance.

    Regards,

    Archit Adwant
  • Hi Archit,

    The file-system provided as part of Vision-SDK is a subset of the file-system we provide as part of Processor SDK Linux Automotive (PSDKLA).
    The tools you're looking for will be available as part of the PSDKLA file-system. You can download this filesystem here downloads.ti.com/.../tisdk-rootfs-image-dra7xx-evm.tar.xz

    Tools such as candump cansend etc are available as part of this file-system (in the usr/bin folder of the extracted file-system). You can copy these binaries to your existing file-system.
    You may find the below links useful on how to use these tools.
    github.com/.../can-utils
    https://elinux.org/Can-utils

    Regards
    Shravan
  • Hi Shravan,

    I downloaded the rootfs from the above link, and copied the programs to my target.
    I got the cansend, candump, but not the canconfig.
    So, i have to use ip for bring up the CAN interface, and i am getting the same problem mentioned above with ip.
    command and response shown below.
    -------------------------------------------------------------------------------
    root@dra7xx-evm:~# ip link set can0 type can bitrate 500000
    ip: either "dev" is duplicate, or "type" is garbage
    ---------------------------------------------------------------------------
    i am not able to bring up the can interface unless the bit rate is set.

    I also tried to update the iproute2 as mentioned in one of the posts.
    basically updated the entire bin, sbin, and usr/bin with programs from the PSDKLS file system.
    Still the problem persists.

    Pls. advise.

    Thanks and Regards,

    Archit Adwant
  • Hi
    Wouldnt cansend work.
    Refer github.com/.../can-utils for more instructions on the tools usage

    Also to review the list of network interfaces and bring up/down an interface wouldnt ifconfig help

    Can you check if #ifconfig -a to see if the can interface is listed correctly
  • Thanks Sriram,

    The problem of configuring DCAN1 could get resolved by changing the link ip.
    It was initially pointing to the busybox.
    I changed it to point to iproute2. thats how i could configure DCAN1 as per the link above.
    Could use the candump and cansend to test dcan1. It was working fine.
    Thanks again.

    Now, i am trying to get DCAN2 working.
    Few questions about it.

    as you mentioned in this emial trail above, i modified the device tree ( dra7_evm.dts).
    I added sections for DCAN2
    i configured three pins for DCAN2,
    the SPI1_CS2 - ( this is to select DCAN2_Tx mode)
    the GPIO6_14 ( this is also to select the mode of DCAN2 Tx
    and the wakeup1 for DCAN2.

    I did not configure the SPI1_CS3, for DCAN2_rx, and also the GPIO6_15 for DCAN2_Rx mode
    Is this not required?

    i observed that the Rx pins are not configured for DCAN1 also. I did not configure the pins for DCAN2.
    But not sure about the SPI1_CS3.

    Kindly advise if the above configuration is correct, and whether i need to configure the rx pins, specifically the SPI1_CS3?

    Thanks and Regards,

    Archit Adwant
  • Archit

    For each of CAN1/CAN2 you need to setup Tx, RX pins. the configuration described in the dra7-evm.dts does include settings for CAN1 Tx, Rx pins - you need to refer to the "dcan1_pins_default" definition for this. You will need something similar for the CAN2 instance.

    You will also need to comprehend the EVM support for CAN2. For enabling CAN2 support, you will need  resistor modification on the EVM for selecting between DCAN2 and I2C3.  Refer to the EVM schematics for more details

    Also, bear in mind  that the EVM includes only one instance of CAN transceiver - to be used with DCAN1. For the other instance, the Tx/RX lines are directly brought out to connector JP3  for external connection

  • Thanks Srirama,

    I built the kernel with the above changes ( Without the SPI1_CS3, for DCAN2_rx, and also the GPIO6_15 for DCAN2_Rx), and it worked.
    i.e. i got the DCAN2 interface, and i could bring it up using the ip program, and also run CANunits, cansend etc. on it.

    Offcorse as you mentioned, could not test the actual output. Checked on my board. the resistors for DCAN2 configuration are missing.
    So blocked on that.

    Also, tested the i2c utilities. So can set the SEL_I2C3_CAN2, to enable the CAN2. But then realized that need hardware changes.

    I have the vision board board with me, which i plan to use for DCAN2. i believe it has the transceiver.

    Will update you once i test it physically.

    Thanks and Regards,

    Archit Adwant
  • Hi Archit,

    were your tests successful Can we close the thread?

    Regards,
    Yordan
  • Hi Archit,

    I haven't heard back from you, I'm assuming you were able to resolve your issue.
    If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Regards,
    Yordan
  • Hi Yordan,

    Sorry about the delayed response.
    Havn't tested it as yet.
    basically facing some difficulty in identifying the exact register changes.
    Will need some more time, but will complete it and update you about it.
    Till then we can close this issue, and will give reference to this question, in case if face a problem
    Thanks & Regards,

    Archit Adwant