[Solved] Colibri IMX7 CAN Not Working

Hello!

I am having problems transmitting and receiving CAN messages on my IMX7D colibri module using the EVAL3 board.

I am concerned it is a DTO issue. I have included my dto here DTO. I have included the dmesg commands log file here dmesg_log. It clearly shows that the flexcan1 peripheral is enabled. However, I noticed that unlike in this post CAN BUS NOT WORKING, mine has not been registered.

Still, using can-utils I am able to configure it and set it up. Command line log has been attached here.cansend_cmdline
Sending data in loopback mode along with candump clearly shows data is being sent from the tx to rx buffer. However, nothing comes on the CAN bus. I am using a logic analyser to check.

It is worth nothing that I am running can-utils in a docker container. I have given it necessary permissions. I have included the script I use to run the container here docker run script.

Thank you very much for your help!

I forgot to mention the hardware. I have already removed jp4 and 5 and drive the CAN pin 55 and 63 to the X38 header giving it access to the can bus transceiver. I check both the CAN RX and TX lines as well as the CANH and CANL but see nothing on either line.

Hi @nagar

Welcome to Toradex community.

Have you tried the Torizon CAN article?if not, please follow the link and let us know.

Thanks for your reply.

I attempted to follow the article and edit the .dtsi file directly but I haven’t been able to compile the edited device tree. I am still working on that.

However, I wrote this .dts file to implement the same changes through an overlay rather than editing the .dtsi file directly. I don’t understand why it wont work.

Thanks for your input.

I previously attempted to use the DTO file mentioned in your article. In my imx7-colibri.dtsi file, there is no pinctrl_gpio5 definition. I assume its because I am using the origin/toradex_5.4.y kernel branch.

I have not placed a 120 ohm resistor yet as there is no signal on the bus or even before the transceiver.

I am using the can-utils through a docker container here.

Hi @nagar,

So, for the CAN bus to work properly, you need to have 120-ohm terminators on both ends of the CAN bus wires, otherwise you can have problems with signaling. That’s valid even for testing, ok?

I would suggest you to verify the wirings and the setup of your CAN Transceiver.
Which CAN Transceiver are you using? How is it connected/set?

Also, it’s advisable to have a second device to be or sending, or receiving messages, in the same bit-rate as yours.

Can you try again with this arrange?

Best regards,
André Curvello

Hi @andrecurvello.tx ,
I apologize for the late reply.
You were right. Placing a 120 ohm resistor at both ends of the CAN bus made it work.
I am using the can transceiver on the eval board itself. I soldered a 120 ohm resistor at the pins of the X2 port.

I will now do an echo test with CAN2 via an external transceiver module.

Thank you very much for your help.

Hi @nagar and @ashok.tx,

Thanks for the feedback @ashok.tx. Yes, the Torizon CAN article is a good start point.

@nagar, please change your DTO similarly to these changes for Colibri iMX7 here.

And about your signals, are you wiring a given CAN Transceiver with a 120-ohm terminator in the CAN bus, right?

About your environment, are you trying to bring-up CAN on a Container, right?

Best regards,
André Curvello

Excellent!

I’m glad to know that it’s now working.

Please let me know if you need anything else.

Best regards,
André Curvello