iMx6 CAN block not initializing at boot

cancel
Showing results for 
Search instead for 
Did you mean: 

iMx6 CAN block not initializing at boot

208 Views
Contributor I

We are using an iMx6 (quad and dual on different boards) and we are seeing infrequent instances where the CAN module does not properly initialize at power on.  This is under yocto linux using socketCAN.  Most of the time things come up and work as expected.  However sometimes the can0 interface cannot be activated.  When I run canconfig can0, the state is STOPPED.  I tell it to start but it stays in the STOPPED state.  A restart command replies that we are not in the BUS-OFF state so it isn't required.  I have also tried ifconfig down/up and that doesn't get it working.  The only thing I have found that will recover it is to do a full reboot of the system.

It seems to happen more frequently when there is CAN traffic during system boot.  I have a bench-top system where my CAN bus is normally idle and I never see the condition when that is the case.  However, if I get CAN traffic running and then reboot, I may see it happen once or twice in a month.  Similarly, when the target device is placed on a vehicle (where CAN is active when we boot), we see the same "stuck in STOP" behavior happen very infrequently.  I am pretty sure something is going wrong at a low level because network manager usually issues the "Gained carrier" message for can0, but when this happens it does not.  That and the fact that canconfig is showing STOPPED tells me that it isn't a problem in the application layer.

Any ideas on what is happening that causes the initialization at boot to fail and force the block into the STOPPED state?  Or possibly how to "kick it in the pants" and get it going again without having to do a full reboot?

Thanks,

Rick

Labels (4)
0 Kudos
3 Replies

24 Views
NXP TechSupport
NXP TechSupport

Hi Rick

if issue happens when there is CAN traffic, this may introduce additional noise on

board and its power supplies. One can check them (for example ripples) with

oscilloscope using guidelines in i.MX6 System Development User’s Guide.

Noise also can affect stability of processor clocks (crystals stability).

https://www.nxp.com/docs/en/user-guide/IMX6DQ6SDLHDG.pdf

For software side one can try latest official nxp Linux L4.14.78_1.0.0

linux/arch/arm/boot/dts/imx6q-sabreauto-flexcan1.dts

imx6q-sabreauto-flexcan1.dts\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Linux L4.14.78_1.0.0 Documentation

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

0 Kudos

24 Views
Contributor I

It is not just CAN traffic, but CAN traffic during initialization of the CAN module.  When the CAN module initializes properly (which is 99% of the time), then everything works fine and we can process CAN traffic for hours.  So I don't believe that it is a general issue with power supply or clock stability.  It is possible that there is some kind of a stability issue early in boot, but CAN seems to be the only module that is having problems.  I am thinking it is something more like we get unexpected interrupts or other changes during init, and the driver perhaps marks the module as "bad" and doesn't allow it to be used by the system.

Thanks,

Rick

0 Kudos

24 Views
NXP TechSupport
NXP TechSupport

to narrow down issue one can enable flexcan clocks in uboot (with CCM_CCGR0 register),

recheck sect.26.7.1 FLEXCAN Initialization Sequence i.MX6DQ Reference Manual 

http://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf 

and try without "socketCAN" just with NXP linux described on link

i.MX Software | NXP 

Best regards
igor

0 Kudos