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.

AM5728: DCAN issues

Part Number: AM5728
Other Parts Discussed in Thread: ISO1050

Hi ,

I am having some problems debugging DCAN on AM5728.

Actually i am using

Chip : AM5728

Sdk : ti-processor-sdk-linux-am57xx-evm-03.00.00.04

Board : custom board

Software : linux-4.4.12

Driver : SDK comes with

Kernel configuration :

 

Circuit diagram :

I run these commands on the board when the print is as follows:

root@am57xx-evm:~# canconfig can0 bitrate 50000 ctrlmode triple-sampling on
can0 bitrate: 50000, sample-point: 0.875
can0 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]

root@am57xx-evm:~# canconfig can0 start
[  393.072922] net can0: c_can_hw_raminit_wait_syscon: time out
[  393.078825] c_can_platform 4ae3c000.can can0: setting BTR=1c18 BRPE=0000
can0 state: ERROR-ACTIVE

root@am57xx-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1
[  419.986200] can: controller area network core (rev 20120528 abi 9)
[  419.992558] NET: Registered protocol family 29
[  420.003311] can: raw protocol (rev 20120528)

root@am57xx-evm:~# dmesg | grep can
[    6.398169] pinctrl-single 4a003400.pinmux: could not add functions for dcan1_pins_default 14288x
[    6.408972] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000, irq=352)
[    6.500225] ahci 4a140000.sata: SSS flag set, parallel bus scan disabled
[  393.072922] net can0: c_can_hw_raminit_wait_syscon: time out
[  393.078825] c_can_platform 4ae3c000.can can0: setting BTR=1c18 BRPE=0000
[  419.986200] can: controller area network core (rev 20120528 abi 9)
[  420.003311] can: raw protocol (rev 20120528)
[  420.008568] c_can_platform 4ae3c000.can can0: entered error warning state
[  420.008645] c_can_platform 4ae3c000.can can0: entered error passive state
[  420.016469] c_can_platform 4ae3c000.can can0: entered bus off state
[  420.016486] c_can_platform 4ae3c000.can can0: bus-off

I refer to this document: http://processors.wiki.ti.com/index.php/Linux_Core_DCAN_User's_Guide

This is described in the documentation: If the CAN bus is not properly connected or some hardware issues DCAN has the intelligence to generate an Error interrupt and corresponding error details on hardware registers.

So these problems should be how to solve it?

I hope to give some help or advice.

Thanks.

Butter.

  • Hi,

    The software team have been notified. They will respond here.
  • Hi Biser,
    Thanks for your help, I will wait for the software team to respond.
    Better
  • By the way, check your connections. It seems to me that you have swapped TX and RX.
  • Hi Biser,

    You are talking about here?

  • Yes, please check the connections on the processor side. ISO1050 RX pin is output, and TX is input.
  • Hi Biser,

    My ISO1050 RX pin is connected to the processor TX,is output.

    ISO1050 TX pin is connected to the processor RX,is input.

    This connection is the opposite?
    I should RX connects to RX,TX connects to TX?

    Thanks.

    Better

  • ISO1050 pin 2 should be connected to AM572x pin G19.
    ISO1050 pin 3 should be connected to AM572x pin G20.

    The net labels are swapped on your schematic. Please check if the PCB connections are as posted above.
  • Hi Biser,

    You are right,I refer to the am335X EVM design, and you said the same.
    Such as our hardware engineers to change the connection I will tell you the results of software testing, may be two days later.

    Thanks.
    Better
  • Hi Biser,

    Your suggestion is correct, I pin the correct connection has improved, but there are still some problems.
    I connect two boards with DB9F-DB9F straight cable.

    When I set the bit rate is no problem.(use " ip link set can0 type can bitrate 50000 triple-sampling on " command)

    I bring up the device in which a plate appeared as follows print:
    root@am57xx-evm:~# ip link set can0 up
    [ 762.012487] net can0: c_can_hw_raminit_wait_syscon: time out
    [ 762.018391] c_can_platform 4ae3c000.can can0: setting BTR=1c18 BRPE=0000

    When I would like to set up two boards were sent and received there is not the same information:
    root@am57xx-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can0, family = 29, type = 3, proto = 1
    root@am57xx-evm:~# dmesg | grep can
    [ 5.836458] ahci 4a140000.sata: SSS flag set, parallel bus scan disabled
    [ 6.056142] pinctrl-single 4a003400.pinmux: could not add functions for dcan1_pins_default 14288x
    [ 6.056800] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000, irq=352)
    [ 762.012487] net can0: c_can_hw_raminit_wait_syscon: time out
    [ 762.018391] c_can_platform 4ae3c000.can can0: setting BTR=1c18 BRPE=0000
    [ 1036.826664] can: controller area network core (rev 20120528 abi 9)
    [ 1036.842855] can: raw protocol (rev 20120528)
    [ 2266.329873] c_can_platform 4ae3c000.can can0: entered error warning state <--------------
    [ 2266.339552] c_can_platform 4ae3c000.can can0: entered error passive state <--------------

    interface = can0, family = 29, type = 3, proto = 1
    ^C
    root@am57xx-evm:~# dmesg | grep can
    [ 6.121183] ahci 4a140000.sata: SSS flag set, parallel bus scan disabled
    [ 6.272289] pinctrl-single 4a003400.pinmux: could not add functions for dcan1_pins_default 14288x
    [ 6.291229] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000, irq=352)
    [ 779.303727] net can0: c_can_hw_raminit_wait_syscon: time out
    [ 779.309570] c_can_platform 4ae3c000.can can0: setting BTR=1c18 BRPE=0000
    [ 1089.981807] can: controller area network core (rev 20120528 abi 9)
    [ 1089.998220] can: raw protocol (rev 20120528)

    When I set the device to receive mode when the two lines of print is gone.

    I hope your software team can help me solve this problem.

    Thanks.

    Butter
  • You must set up as follows (example given is for can0):

    To start the interface on both boards type:
    canconfig can0 bitrate 1000000 ctrlmode triple-sampling on
    canconfig can0 start

    On the receiving side type:
    candump can0

    On the transmit side type:
    cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88

    Repeat last two steps in reverse direction.

    To stop the interface on both boards type:
    canconfig can0 stop
  • Hi Biser,
    These I have tried, the error is the same.

    root@am57xx-evm:~# canconfig can0 bitrate 1000000 ctrlmode triple-sampling on
    can0 bitrate: 1000000, sample-point: 0.750
    can0 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]
    root@am57xx-evm:~# canconfig can0 start
    [ 152.712228] net can0: c_can_hw_raminit_wait_syscon: time out
    [ 152.718141] c_can_platform 4ae3c000.can can0: setting BTR=4d00 BRPE=0000
    can0 state: ERROR-ACTIVE

    root@am57xx-evm:~# ifconfig
    can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    UP RUNNING 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:96

    root@am57xx-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
    interface = can0, family = 29, type = 3, proto = 1
    [ 193.476873] can: controller area network core (rev 20120528 abi 9)
    [ 193.483347] NET: Registered protocol family 29
    [ 193.493555] can: raw protocol (rev 20120528)

    root@am57xx-evm:~# dmesg | grep can
    [ 5.826472] ahci 4a140000.sata: SSS flag set, parallel bus scan disabled
    [ 5.913916] pinctrl-single 4a003400.pinmux: could not add functions for dcan1_pins_default 14288x
    [ 5.931418] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000, irq=352)
    [ 152.712228] net can0: c_can_hw_raminit_wait_syscon: time out
    [ 152.718141] c_can_platform 4ae3c000.can can0: setting BTR=4d00 BRPE=0000
    [ 193.476873] can: controller area network core (rev 20120528 abi 9)
    [ 193.493555] can: raw protocol (rev 20120528)
    [ 193.499988] c_can_platform 4ae3c000.can can0: entered error warning state
    [ 193.500468] c_can_platform 4ae3c000.can can0: entered error passive state
    [ 218.479082] omap_hwmod: dcan1: _wait_target_disable failed
    [ 218.493001] omap_hwmod: dcan1: _wait_target_disable failed
    [ 218.507508] omap_hwmod: dcan1: _wait_target_disable failed

    root@am57xx-evm:~# candump can0
    interface = can0, family = 29, type = 3, proto = 1
    The receiver did not receive anything, has been parked here.

    root@am57xx-evm:~# lsmod | grep can
    can_raw 6589 0
    can 29605 1 can_raw
    c_can_platform 6604 0
    c_can 10171 1 c_can_platform
    can_dev 14231 1 c_can

    I would like to know there is no problem with my kernel configuration, CAN device also need other drive?

    Thanks.

    Butter
  • You must run candump on one board first, and after that run cansend on the other board.
  • Dear Biser,

    Yes, that's what I did.
    But when I started the device on the wrong, the back has been wrong.

    root@am57xx-evm:~# canconfig can0 bitrate 1000000 ctrlmode triple-sampling on
    can0 bitrate: 1000000, sample-point: 0.750
    can0 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]

    root@am57xx-evm:~# canconfig can0 start
    [ 189.602296] net can0: c_can_hw_raminit_wait_syscon: time out
    [ 189.608198] c_can_platform 4ae3c000.can can0: setting BTR=4d00 BRPE=0000
    can0 state: ERROR-ACTIVE

    Thanks.
    BUtter
  • One other thing to check is if VCC_DCAN is connected on the two boards (pin 9). If this is the case you should remove this connection.
  • Dear Biser,

    Now I can test to send and receive, because I am a board interface connection is wrong, but when you start the device will still appear "ERROR-ACTIVE" print.

    You say this is the 9-pin? But I refer to AM335XEVM is so connected.

  • If you connect pin 9 to pin 9 you will have the outputs of the two CAN voltage regulators U10 shorted.
  • Dear Biser,

    Thank you very much for your reply, which helped me a lot.

    Thankd.