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.

SN65HVD230: Interfacing issue with CAN controller.

Part Number: SN65HVD230

We are using CJMCU-230 which has SN65HVD230 CAN transceiver embedded in it.

Image result for cjmcu-230


Our setup is to achieve the CAN msg communication between 2 CAN nodes.

Using CAN utilities , we are trying to test CAN interfaces by sending and receiving data's in external loopback mode (can0 <---> can1).

But we are not able to achieve the proper target. There is no error on sending the messages can0. But error in receiving at can1. Similar is the case while sending from can1 and error at can0 while receiving.

Hope someone can help us further with this information to achieve the communication between the 2 CAN nodes.

Hoping a quick reply. Thanks in advance.

  • Hello,

    Are you able to use an oscilloscope to observe the signal waveforms? If so, it would be good to examine the CANH and CANL signals at both the sending node and the receiving node to see if there are any issues with the connections. (This is good to check since each board seems to be working individually - i.e., no errors on sent messages.)

    Regards,
    Max
  • Hello Max,

    Thank you for your quick reply.

    I have not connect any oscilloscope yet. BTW, I am copying below the observations:

    command: cansend can1 123#aabbccdd


    Kernel log at: candump can0
    [ 147.176805] mttcan c320000.mttcan can1: IR 0xb800000 PSR 0x7e5
    [ 1429.520726] mttcan c310000.mttcan can1: Bit0 Error Detected
    [ 1429.526677] mttcan c310000.mttcan can1: IR 0x8010000 PSR 0x71d
    [ 1429.535526] mttcan c310000.mttcan can1: entered error warning state
    [ 1429.542107] mttcan c310000.mttcan can1: entered error passive state
    [ 1429.548716] mttcan c310000.mttcan can1: entered bus off state
    [ 1429.554754] mttcan c310000.mttcan can1: Bit0 Error Detected
    [ 1429.560610] mttcan c310000.mttcan can1: IR 0xb800000 PSR 0x7e5

    packet details:
    command: ip -details -statistics link show can0
    6: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can promiscuity 0
    can <BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
    bitrate 500000 sample-point 0.875
    tq 25 prop-seg 34 phase-seg1 35 phase-seg2 10 sjw 1
    mttcan: tseg1 2..255 tseg2 0..127 sjw 1..127 brp 1..511 brp-inc 1
    dbitrate 2000000 dsample-point 0.750
    dtq 25 dprop-seg 7 dphase-seg1 7 dphase-seg2 5 dsjw 1
    mttcan: dtseg1 1..31 dtseg2 0..15 dsjw 1..15 dbrp 1..15 dbrp-inc 1
    clock 40000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0 0 0 0 0 0
    RX: bytes packets errors dropped overrun mcast
    0 0 0 0 0 0
    TX: bytes packets errors dropped carrier collsns
    0 0 0 0 0 0

    command: ip -details -statistics link show can1
    7: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
    link/can promiscuity 0
    can <BERR-REPORTING,FD> state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
    bitrate 500000 sample-point 0.875
    tq 25 prop-seg 34 phase-seg1 35 phase-seg2 10 sjw 1
    mttcan: tseg1 2..255 tseg2 0..127 sjw 1..127 brp 1..511 brp-inc 1
    dbitrate 2000000 dsample-point 0.750
    dtq 25 dprop-seg 7 dphase-seg1 7 dphase-seg2 5 dsjw 1
    mttcan: dtseg1 1..31 dtseg2 0..15 dsjw 1..15 dbrp 1..15 dbrp-inc 1
    clock 40000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0 2 0 1 1 0
    RX: bytes packets errors dropped overrun mcast
    40 5 2 0 0 0
    TX: bytes packets errors dropped carrier collsns
    0 0 0 0 0 0


    Please help me knowing what could have been wrong here, is it a configuration problem ?


    Thanks!

  • I'm not too experienced in reading these logs, but to me the relevant info is just that you are getting bit errors on the CAN interface. It could be either an issue with physical signaling or it could be an issue with the configuration. If you are able to see the waveforms then you could quickly verify whether or not the signals are as expected (right timing and voltage levels). If that is verified to be OK, then I would check the CAN controller configuration to make sure all the timing parameters (segment times, segment jump widths, baud rate prescalers/other variables) are correct per the data rate you intent to use.

    Max