Flexcan device error on imx6q board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flexcan device error on imx6q board

2,540 Views
hkhunkim
Contributor I

Hello, I have a hard time on using CAN BUS with imx6q board. I have been using Yocto project for customizing a board.

For development board (imx6q qiyang board), in dmesg | grep 'can' it says

root@qiyang ~$ dmesg | grep 'can'                                               
vcan: Virtual CAN interface driver                                              
flexcan netdevice driver                                                        
flexcan imx6q-flexcan.0: device registered (reg_base=c09b8000, irq=142)         
flexcan imx6q-flexcan.1: device registered (reg_base=c09e8000, irq=143)         
can: controller area network core (rev 20090105 abi 8)                          
can: raw protocol (rev 20090105)                                                
can: broadcast manager protocol (rev 20090105 t)                                
flexcan imx6q-flexcan.0: bit-timing not yet defined                             
flexcan imx6q-flexcan.0: writing ctrl=0x0e312005 

And, it works well, but in terms of imx6qsabreauto board with fslc based yocto linux, it says in dmesg | grep 'can

root@imx6qdlsabreauto:/# dmesg | grep 'can'

[    2.356307] can: controller area network core (rev 20120528 abi 9)           
[    2.356392] can: raw protocol (rev 20120528)                                 
[    2.356397] can: broadcast manager protocol (rev 20161123 t)                 
[    2.356406] can: netlink gateway (rev 20130117) max_hops=1                   
[    2.489689] can-stby: supplied by can-en                                     
[    2.491269] flexcan 2094000.flexcan: device registered (reg_base=f0bac000, i)
[    2.602853] can-en: disabling                                                
[    2.602857] can-stby: disabling                                              
[  368.185948] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready                                      

Could you make any advices for moving forward?

Thank you in advance.

Labels (3)
0 Kudos
5 Replies

1,875 Views
hkhunkim
Contributor I

I found that the main difference between qiyang and imx6qsabreauto board is that

Qiyang

can: raw protocol (rev 20090105)                                                
can: broadcast manager protocol (rev 20090105 t)

imx6qsabreauto

[    2.346155] can: raw protocol (rev 20120528)                                 
[    2.346159] can: broadcast manager protocol (rev 20161123 t)

As you could see raw protocol and broadcast manager protocol have different numbers.

Does it cause a problem like every time I try to send can, I have got flexcan 2094000.flexcan can0: New error state: 1

0 Kudos

1,875 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello HUN,

You are using other CAN:

can: raw protocol (rev 20090105)                   

and the NXP:

[    2.356392] can: raw protocol (rev 20120528)  

Or maybe another BSP.

Regards

0 Kudos

1,875 Views
hkhunkim
Contributor I

I'm using two boards (imx6 qiyang board and imx6q sabre auto)

The problem is that as I mentioned earlier, imx6qsabreauto does not support flexcan device, but imx6 qiyang works well.

I think your reply implies that I am using other CAN in NXP board.

Please see my above question again..

0 Kudos

1,875 Views
hkhunkim
Contributor I

Could you tell me more details about it?

So, does it mean I am using other CAN driver to use NXP flexcan?

But, in kernel menuconfig, I only activated NXP flexcan device..

And then, one more question, if I am using other CAN:

can: raw protocol (rev 20090105),

why imx6 qiyang board seems to work well for a receive and transmit of CAN  with the same message.

can: raw protocol (rev 20090105)

0 Kudos

1,875 Views
hkhunkim
Contributor I

Here is my update,

With menuconfig option, I have activated virtual CAN interface driver, then I have got dmesg with imx6qsabreauto board

[    1.680808] vcan: Virtual CAN interface driver                               
[    2.214091] snvs-secvio 20cc000.caam-snvs: can't get snvs clock              
[    2.346068] can: controller area network core (rev 20120528 abi 9)           
[    2.346155] can: raw protocol (rev 20120528)                                 
[    2.346159] can: broadcast manager protocol (rev 20161123 t)                 
[    2.346168] can: netlink gateway (rev 20130117) max_hops=1                   
[    2.475128] can-stby: supplied by can-en                                     
[    2.476706] flexcan 2094000.flexcan: gpr /soc/aips-bus@02000000/iomuxc-gpr@08
[    2.476760] flexcan 2094000.flexcan: device registered (reg_base=f0bac000, i)
[    2.571291] can-en: disabling                                                
[    2.571294] can-stby: disabling                                              
[   74.394949] flexcan 2094000.flexcan can0: writing ctrl=0x0e312005            
[   74.394978] flexcan 2094000.flexcan can0: flexcan_set_bittiming: mcr=0x598005
[   74.394998] flexcan 2094000.flexcan can0: flexcan_chip_start: writing mcr=0x9
[   74.395017] flexcan 2094000.flexcan can0: flexcan_chip_start: writing ctrl=05
[   74.396487] flexcan 2094000.flexcan can0: flexcan_chip_start: reading mcr=0x5
[   74.398067] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

But, with cansend can0 5A1#11.22.33.44.55.66.77.88 command, I have got

[  224.299652] flexcan 2094000.flexcan can0: New error state: 1    

Could you let me know what I have to look for?

0 Kudos