Turning off one CAN turns off other too - Colibri iMX8X


On Colibri iMX8X we’re using one CAN bus from M4 which is working without an issue. We’re also planning to use another CAN bus from Linux. Problem occurs when the Linux one fails configuration (e.g. invalid /etc/network/interfaces file), crashes or is just turned off (through ip link set dev can0 down), it hard faults the M4.

It looks like Linux CAN driver when turning off the periphery also turns off the LPCG for this CAN. But this also turns off the clock for the M4 CAN, because even though by the addresses there are distinct LPCGs for each CAN, physically there is only one according to the reference manual.

Are there plans to fix it or modify the behavior or is there a recommended workaround?

Thank you.
Best regards

Hi @marekh ,

Welcome to the Toradex community! :tada: Feel free to browse around and explore the different areas.

Can you state which OS you’re using and which version of it? Are you using Torizon?

Best Regards

Hi Kevin,

thank you!

We’re using kernel from you, BSP 5.7 specifically. We’re not using Torizon, userspace is Debian 10.

Best regards

Hi @marekh,

Are you still facing this issue? Can you give the status of this problem right now?

Can you also share how is the device tree set up on the Linux side? Have you disabled it to use with the M4 cortex?

Best Regards,

Hi Hiago,

The issue is still the same.

As for device tree, one CAN is in DTB, the other one is not (to be accessed only from M4). The issue is really that drivers approach it, like the CAN busses have independent clock control (they have even separate addresses), but under the hood, there is only one.

The workaround we’ve come up is to disable the turning off the LPCG in the kernel driver, when the interface is disabled. But it doesn’t feel the most proper. Do you other solution or are you planning something from your side?

Best regards,