Apalis i.MX6Q EVK running CAN bus at 1 Mbps

I have Apalis i.MX6 2GB IT module installed on the EVK. I am running Linux 4.9.87.

I can run CAN bus between the EVK and PCAN-View simulator using a USB/CAN adapter at 500,000 Bps. When I switch to 1,000,000 Bps I get “bus-off” error. I tested it with and without bus termination.

The CAN simulator and USB/CAN adapter are verified to work at 1,000,000 Bps. We used the same Apalis i.MX6 modules on our custom boards and we were running the bus at 1,000,000 Bps.

Is there any limitation on the EVK itself that prevents us from using 1,000,000 Bps?

Greetings @mikeb!

We have customers that successfully use CAN on the Apalis iMX6 with the Apalis Evaluation Board at that rate, so it doesn’t look like a carrier board issue at first.

How are you setting up the bus and how does the error manifest itself? My first guess would be an impedance mismatch due to a lack of a terminator, but we can also verify the wiring itself.

We’ll try to reproduce that on our side too.

We also used Apalis i.MX6 module on our custom carrier board, and run CAN bus at 1 Mbps without difficulties.

My test setup is Apalis i.MX6 EVK CAN port 1 connected to Peak Systems PCAN-USB adapter, connected directly to the EVK port. I use PCAN-View on Window 7 as a test program. This is the same setup that works well with our custom carrier board.

On the Apalis module side I run Linux and use the following console commands:

ip link set can0 down
ip link set can0 type can bitrate 1000000
ip link set can0 up
candump can0 &
cansend can0 01f@1122334455667788

The same set of commands works well for 500,000 Bps.

I attached a part of our custom carrier board CAN bus circuit schematic, a functional equivalent of EVK schematics on sheet 23.

When I use ifconfig, it shows BUS OFF for can0. candump does not show any input, and candsend does not send any message out to the bus.

Where did you attach the files?
I can not find them.

alt text

I dragged and dropped the file. It contains the schematics of the CAN interface on our custom carrier board.

Please let me know if you got the drawing.

Here is the block diagram of connections used to test the Apalis EVK CAN bus:

alt text

There are two laptops connected to CAN bus over PCAN USB adapters at the ends of the 20 cm long “bus”, each terminated with the 120 Ohm resistor. The Apalis i.MX6 EVK is connected in the middle of the bus via CAN 1 connector. So, there are 3 “devices” on the bus.

At data rate of 500 Kbps both laptops and the EVK exchange CAN messages correctly. When I switch all of them to 1 Mbps, the two laptops continue to communicate, while there is a problem with communication with the Apalis i.MX6 EVK. Initially the EVK receives CAN messages and displays them using candump Linux command. However, after an attempt to send a message using cansend Linux command, the EVK goes into the BUS-OFF state:

root@b2qt-apalis-imx6:/opt/b1es/bin# ip -details -statistics link show can0
2: can0: mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 599724
can state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 0
bitrate 1000000 sample-point 0.733
tq 66 prop-seg 5 phase-seg1 5 phase-seg2 4 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 4 4 numtxqueues 599724 numrxqueues 599724 gso_max_size 599724 gso_max_segs 599724
RX: bytes packets errors dropped overrun mcast
408 51 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 3 0 0

What may be causing EVK failure to send a CAN message?

Sorry, wrong diagram!

alt text

As we can see from the Apalis CAN bus interface schematics (page 23), there are two CAN ports, driven by the MCP2551 transceivers. The RS (pin 8) on each transceiver is connected to the ground via a 0 Ohm resistor (R97 and R103). However, the MCP2551 datasheet reads:​

“… High-speed mode is selected by connecting the RS pin to VSS. In this mode, the transmitter output drivers have fast output rise and fall times to support high-speed CAN bus rates…”

Is 1 Mbps considered the high-speed mode? Does this mean that we need to remove R97 and R103 and connect RS (pin 8) on both transceivers to the VSS? If so, what is hardware-wise the best way to do it?

Hello @mikeb!

The maximum speed for regular CAN (not CAN-FD) is 1Mbps, so I assume that is considered high speed.

Just to confirm, I assume you’re using FlexCAN with the MCP2551 transceiver, right?

I’ll check with the hardware team about making these changes. Meanwhile, we’ve tested this configuration on the Ixora Carrier Board and that works. Can you please compare the transceiver implementation on that?