Help Required regarding using CAN bus on SoloX (6SX SABRE-SDB)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help Required regarding using CAN bus on SoloX (6SX SABRE-SDB)

Jump to solution
1,807 Views
ShrikantBobade
Contributor II

Hello All,

I am preparing CAN n/w set-up using two SoloX (6SX SABRE-SDB) targets. I am facing difficulties in getting the compatible CAN cable.

Is there any quick reference for preparing Or getting a compatible CAN cable ?

So far I have prepared a customized CAN cable but unable to get the CAN communication working.[using canutils]

with 2 DB9 female connectors & two set of wires

a.

pin 2 of first DB9 <--> pin 2 of second DB9

pin 7 of first DB9 <--> pin 7 of second DB9

b.

Tried the in two sets:

i. null CAN cable

ii. 120 ohm resistor between pin 2 and pin 7 in the DB9 female connector.[this 120 resistor setting at both DB9 connectors]

On target side, I am getting the can0 & can1 interface up:

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:142

can1  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:143

[1.595824] flexcan 2090000.can: gpr /soc/aips-bus@02000000/iomuxc-gpr@020e4000 req_gpr 0x10 req_bit 1 ack_gpr 0x10 ack_bit 17
[1.595896] flexcan 2090000.can: device registered (reg_base=f01e0000, irq=142)
[1.611179] flexcan 2094000.can: gpr /soc/aips-bus@02000000/iomuxc-gpr@020e4000 req_gpr 0x10 req_bit 2 ack_gpr 0x10 ack_bit 18
[1.611243] flexcan 2094000.can: device registered (reg_base=f01e8000, irq=143)

I am using fsl kernel v3.14 with CONFIG_CAN_FLEXCAN=y enabled.

ref using canutils: IMX6 CAN configuration using canutils and libsocketcan

Any pointers or references on getting Or preparing  compatible CAN cable will be a great help..

Thanks

Shrikant

Labels (4)
1 Solution
1,218 Views
Pavel
NXP Employee
NXP Employee

Your connection is correct. See the following documents:

http://www.esd-electronics-usa.com/Shared/Library/CAN-Wiring-3.pdf

http://www.ti.com/lit/an/slla270/slla270.pdf

https://en.wikipedia.org/wiki/CAN_bus

The P1010 also contains FlexCAN controller. See the following page for FlexCAN testing under Linux:

http://www.freescale.com/infocenter/index.jsp?topic=%2FQORIQSDK%2F2151489.html


Have a great day,
Pavel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

3 Replies
1,219 Views
Pavel
NXP Employee
NXP Employee

Your connection is correct. See the following documents:

http://www.esd-electronics-usa.com/Shared/Library/CAN-Wiring-3.pdf

http://www.ti.com/lit/an/slla270/slla270.pdf

https://en.wikipedia.org/wiki/CAN_bus

The P1010 also contains FlexCAN controller. See the following page for FlexCAN testing under Linux:

http://www.freescale.com/infocenter/index.jsp?topic=%2FQORIQSDK%2F2151489.html


Have a great day,
Pavel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,218 Views
ShrikantBobade
Contributor II

Hello Pavel,

Thanks a lot for the quick response. went through the shared references !

now facing the CAN bus-off error.. below are the CAN communication details..

On first SoloX target:

:~# ip link set can0 up type can bitrate 125000

:~# dmesg -c

[   80.008830] flexcan 2090000.can can0: writing ctrl=0x0e312005

[   80.019421] flexcan 2090000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x0e312005

[   80.019493] flexcan 2090000.can can0: flexcan_chip_start: writing mcr=0x7de2020d

[   80.019543] flexcan 2090000.can can0: flexcan_chip_start: writing ctrl=0x0e31ac55

[   80.021531] flexcan 2090000.can can0: flexcan_chip_start: reading mcr=0x64e2020d ctrl=0x0e31ac55

:~#

:~# cansend -e can0 0 1 2 3 4 5 6 7 --loop=2

interface = can0, family = 29, type = 3, proto = 1

:~# dmesg

[  167.440742] flexcan 2090000.can can0: Error Warning IRQ

[  167.440814] flexcan 2090000.can can0: Error Passive IRQ

[  167.443903] flexcan 2090000.can can0: bus-off

:~# ip -details -statistics link show can0

2: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10

    link/can  promiscuity 0

    can state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 0

      bitrate 125000 sample-point 0.875

      tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1

      flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1

      clock 30000000

      re-started bus-errors arbit-lost error-warn error-pass bus-off

      0          0          0          1          1          1        

    RX: bytes  packets  errors  dropped overrun mcast  

    16         2        0       0       0       0      

    TX: bytes  packets  errors  dropped carrier collsns

    0          0        0       0       0       0      

:~#

On second SoloX target:

:~# ip link set can0 up type can bitrate 125000

:~# dmesg -c

[  142.380312] flexcan 2090000.can can0: writing ctrl=0x0e312005

[  142.392468] flexcan 2090000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x0e312005

[  142.392504] flexcan 2090000.can can0: flexcan_chip_start: writing mcr=0x7de2020d

[  142.392529] flexcan 2090000.can can0: flexcan_chip_start: writing ctrl=0x0e31ac55

[  142.392871] flexcan 2090000.can can0: flexcan_chip_start: reading mcr=0x64e2020d ctrl=0x0e31ac55

:~#

:~# candump can0

interface = can0, family = 29, type = 3, proto = 1

^C

:~# dmesg

:~# ip -details -statistics link show can0

2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10

    link/can  promiscuity 0

    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0

      bitrate 125000 sample-point 0.875

      tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1

      flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1

      clock 30000000

      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      

:~#

I am facing a bus-off error on the first target can0 interface. from where I am sending CAN messages.

The CAN cables I used in two sets are in good connectivity mode.. checked with multimeter..

Any pointers or references  on debugging the bus-off error... will be a great help! Thanks!

Thanks

Shrikant

0 Kudos
1,218 Views
ShrikantBobade
Contributor II

Hello Pavel,

Thanks ! Now using your provided CAN references & fido fsl ref.

I am able to get the CAN communication working on SoloX.

Thanks for quick help.

Thanks

Shrikant

0 Kudos