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.

SK-TDA4VM: MCAN description and patch

Part Number: SK-TDA4VM

Tool/software:

Hi, experts 

1.
There are some information about 4-CAN connectors but there isn't a detail demonstration about what 4-CANs are nor why 4-CANs are in SK-TDA4VM in the user manual. So I searched like this on web. Would you please correct if there is something not true information in here? Or if you have more information about the CANs, please let me know.

CAN Interface Function and Differences
MCU_CAN0 - CAN interface connected to the MCU subsystem.
- Mainly supports key MCU tasks like system management and safety functions.
- Suitable for tasks requiring low latency and high reliability.
CAN5 - General-purpose CAN interface connected to the SoC subsystem.
- Handles typical communication tasks and can interface with various external devices.
CAN0 - CAN interface connected to the main processor.
- Supports application-level data exchange, such as sensor data collection and other diverse uses.
CAN9 - CAN interface that can be used for applications requiring high-speed communication.
- Provides similar functionality to CAN0 but supports additional expansion and high-speed communication.

2.
I patched up like the articles. https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1334615/processor-sdk-j721e-can-driver-support-needed-for-a72-linux-of-processor-sdk-linux-sk-tda4vm/5119410?tisearch=e2e-sitesearch&keymatch=%25252520user%2525253A477602#5119410

0001-Enable-MCAN-for-SK-TDA4VM-on-6.1-kernel.patch

root@tda4vm-sk:/opt/edgeai-gst-apps# sudo ip link set can0 up
root@tda4vm-sk:/opt/edgeai-gst-apps#
root@tda4vm-sk:/opt/edgeai-gst-apps# lsmod | grep can
can_raw 24576 0
can 24576 1 can_raw
phy_can_transceiver 16384 4
m_can_platform 20480 0
m_can 36864 1 m_can_platform
can_dev 45056 1 m_can
root@tda4vm-sk:/opt/edgeai-gst-apps# ip link show type can
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can
4: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
5: can2: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
6: can3: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10




CAN0 :
MCU_MCAN0

CAN1 : MCAN0

CAN2 : MCAN5

CAN3 : MCAN9

cansend can0 123#DEADBEEF
cansend can1 123#DEADBEEF
cansend can2 123#DEADBEEF
cansend can3 123#DEADBEEF

When connecting the CAN interfaces of one EVM (Evaluation Module) to another EVM, CAN communication is occurring at MCAN0/5/9 and signals are good.
But there is no signal on MCU_MCAN0. 

In other CAN ports, the voltage level on H/L is approximately 2.4V in a standby state, but the MCU CAN port shows a level of 0V even when in standby. This suggests that the MCU CAN port might not be ready state for operating . What could be the reason for this?


3.
I connected the cables in a loop sequentially as CAN0 -CAN9 , CAN0-CAN5, or CAN0-MCU_CAN0.
After running the above command set and sending each connections, no signals were observed on any of the ports connection.


  1. Boot up the board and log in
  2. Initialize all 4 CAN interfaces:
    ip link set can0 type can bitrate 1000000
    ip link set can1 type can bitrate 1000000
    ip link set can2 type can bitrate 1000000
    ip link set can3 type can bitrate 1000000
  3. Turn all 4 CAN interfaces on:
    ip link set can0 up
    ip link set can1 up
    ip link set can2 up
    ip link set can3 up
  4. Start listening on all 4 CAN interfaces:
    candump can0 &
    candump can1 &
    candump can2 &
    candump can3 &
  5. Send a message from all 4 CAN interfaces:
    cansend can0 123#DEADBEEF
    cansend can1 123#DEADBEEF
    cansend can2 123#DEADBEEF
    cansend can3 123#DEADBEEF

Does the TI_SDK support looping like these? 

  • Hi Jaechon, 

    From SoC perspective, there is no particular difference in usecase between the different CAN interfaces. The only difference between Main_MCAN and MCU_MCAN is that MCU_MCAN is connected to WKUP domain, so when the SoC operates in a low power mode or some initial state where only the WKUP domain is active, MCU_MCAN can be accessible. 

    The technical reference manual's section 12.4.4 goes into detail for the MCAN modules if you would like more detail: https://www.ti.com/lit/zip/spruil1

    As for MCU_MCAN0 not working, which SDK is the patch applied to? I think that patch is for SDK 9.1 or 9.2, but if you are on an earlier SDK, please try applying to a newer SDK. Alternatively, SDK 10.0 just came out and that should already have the MCAN nodes in the device tree defined so no patch is necessary.

    Regards,

    Takuma

  • MCU_MCAN is that MCU_MCAN is connected to WKUP domain, so when the SoC operates in a low power mode or some initial state where only the WKUP domain is active, MCU_MCAN can be accessible. 

    MCU_MCAN would not be active in normal operation state, is it?

  • Is there any manual setting for making only WKUP domain is active?

  • Hi Jaechoen,

    WKUP domain should be active, and there is no extra step required. Please think of all of the MCAN interfaces as the same as each other in terms of functionality and steps to enable.

    Again, my recommendation for next steps would be to try out newer SDKs. If our TI EVM is used, then the set up should be relatively smooth because there is no porting needed. Especially SDK 10.0 should be smooth, since you can use a prebuilt SD card image that already has MCAN nodes defined in device tree.

    Regards,

    Takuma