Problem to receive frames CAN in IMX6q-sdb

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to receive frames CAN in IMX6q-sdb

1,880 Views
Contributor II

hello,

I am trying to connect 2 freescale board through CAN bus (output J10). At first , I installed drivers can, can-dev, can-raw, flexcan.

then, I have done the configuration of the CAN nework, however as you can see on the display all my frames are droped.

please help me to successfully connect these boards.

ip link set can0 up type can bitrate 125000

flexcan 2090000.flexcan can0: writing ctrl=0x0e312055

flexcan 2090000.flexcan can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=5

flexcan 2090000.flexcan can0: flexcan_chip_start: writing mcr=0x79a20208

flexcan 2090000.flexcan can0: flexcan_chip_start: writing ctrl=0x0e31ac55

flexcan 2090000.flexcan can0: flexcan_chip_start: reading mcr=0x60a20208 5

root@rt-imx6q-sabresd:~# cansend can0 100#11.22.33.44

root@rt-imx6q-sabresd:~# ip -det -sta link show can0

2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN m0

    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       3       0       0    

8 Replies

22 Views
Senior Contributor I

Problem solved: It is not well documented, but the candump utility is used to echo packets received after it is run. It is not used to dump packets that have already been sent. Don't know if this was obvious to others but it wasn't to me.

0 Kudos

22 Views
NXP Employee
NXP Employee

Hi,

On board 2, have you tried to do the next?

canecho can0 -v

The board will show the data comming from board 1.

/Alejandro

0 Kudos

22 Views
Contributor II

Hi thanks for your answer, i test it with " candump can0" on the second board but i receive nothing

0 Kudos

22 Views
NXP Employee
NXP Employee

I wonder if you checked with a scope that the can frames are generated.

/Alejandro

0 Kudos

22 Views
Contributor II

Sorry but i didn't understand what is the scope generator frames that you're talking about.

do you think that it's a problem of " flexcan supply xceiver not found " or "the failed to load a unit dbus.soket" ?

root@rt-imx6q-sabresd:~# dmesg | grep -i can

[    1.519210] ahci ahci: SSS flag set, parallel bus scan disabled

[    1.564512] vcan: Virtual CAN interface driver

[    1.567706] CAN device driver interface

[    1.570529] 2090000.flexcan supply xceiver not found, using dummy regulator

[    1.577237] flexcan 2090000.flexcan: device registered (reg_base=c0a10000, irq=142)

[    1.583781] 2094000.flexcan supply xceiver not found, using dummy regulator

[    1.590439] flexcan 2094000.flexcan: device registered (reg_base=c0a18000, irq=143)

[    2.572608] can: controller area network core (rev 20120528 abi 9)

[    2.580829] can: raw protocol (rev 20120528)

[    2.583811] can: broadcast manager protocol (rev 20120528 t)

[    2.588227] can: netlink gateway (rev 20130117) max_hops=1

[    3.451347] systemd[1]: Cannot add dependency job for unit dbus.socket, ignoring: Unit dbus.socket failed to load: No such file or directory.

[    3.462943] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No suc.

0 Kudos

22 Views
NXP Employee
NXP Employee

Hi,

You did not mention that you were getting that error (flexcan supply xceiver not found )before.

Which BSP are you using?

Are you using the SABRE-SD board? Are you sure the transceiver is populated?

Regardoing the scope, I just wanted you to make sure that the transmitter is in fact sending data over the CAN bus.

Best Regards,

Alejandro

0 Kudos

22 Views
Senior Contributor I

Was this ever resolved? I am getting the same boot message of "supply xceiver not found, using dummy regulator". I have two CAN interfaces that I am looping between. the cansend command seems to work fine, but the candump command does not return anything. It just sits there and never returns to the prompt. If I stop the CPU with an emulator, it is in the idle loop as if no command was ever sent. A control-C will terminate the command. Any idea what is wrong?

Device tree entry:

&flexcan1 {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_flexcan1>;

    trx-stby-gpio = GP_CAN1_SILENT;

    status = "okay";

};

&flexcan2 {

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_flexcan2>;

    trx-stby-gpio = GP_CAN2_SILENT;

    status = "okay";

};

dmesg output:

root@imx6qc398:~# dmesg | grep -i can

[    1.216417] ahci-imx 2200000.sata: SSS flag set, parallel bus scan disabled

[    1.277600] vcan: Virtual CAN interface driver

[    1.280753] CAN device driver interface

[    1.283713] 2090000.can supply xceiver not found, using dummy regulator

[    1.289683] flexcan 2090000.can: gpr /soc/aips-bus@02000000/iomuxc-gpr@020e0000 req_gpr 0x34 req_bit 28 ack_gpr 0x10 ack_bit 17

[    1.289738] flexcan 2090000.can: device registered (reg_base=f0288000, irq=142)

[    1.295929] 2094000.can supply xceiver not found, using dummy regulator

[    1.301847] flexcan 2094000.can: gpr /soc/aips-bus@02000000/iomuxc-gpr@020e0000 req_gpr 0x34 req_bit 29 ack_gpr 0x10 ack_bit 18

[    1.301898] flexcan 2094000.can: device registered (reg_base=f0290000, irq=143)

[    2.711977] can: controller area network core (rev 20120528 abi 9)

[    2.720120] can: raw protocol (rev 20120528)

[    2.723096] can: broadcast manager protocol (rev 20120528 t)

[    2.727487] can: netlink gateway (rev 20130117) max_hops=1

[   48.899409] flexcan 2090000.can can0: writing ctrl=0x03292005

[   48.903963] flexcan 2090000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x03292005

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

[   48.904004] flexcan 2090000.can can0: flexcan_chip_start: writing ctrl=0x0329ac55

[   48.904083] flexcan 2090000.can can0: flexcan_chip_start: reading mcr=0x64e2020d ctrl=0x0329ac55

[   62.061294] flexcan 2094000.can can1: writing ctrl=0x03292005

[   62.065832] flexcan 2094000.can can1: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x03292005

[   62.065851] flexcan 2094000.can can1: flexcan_chip_start: writing mcr=0x7de2020d

[   62.065869] flexcan 2094000.can can1: flexcan_chip_start: writing ctrl=0x0329ac55

[   62.065947] flexcan 2094000.can can1: flexcan_chip_start: reading mcr=0x64e2020d ctrl=0x0329ac55

22 Views
Contributor II

Hi,Paul DeMetrotion

How to slove problem:" 2090000.can supply xceiver not found, using dummy regulato"  ?

I met it too!

And I can get nothing by Oscilloscope(TX Pin) after command "cansend  can0 001#11223344".

Have something wrong with DTS file?

BSP:linux3.14.28

Thank you very much!

0 Kudos