AnsweredAssumed Answered

How to Enable or USE Flexcan2 in device tree(or etc) on imx6qsabresd custom board

Question asked by Seung Hyun Park on Mar 12, 2019
Latest reply on Mar 12, 2019 by Seung Hyun Park

Hello Everyone.

 

I'm trying to enable Flexcan2 on imx6qsabresd custom board.

I'm also testing the board with two identical boards(device tree binary is : imx6q-sabresd.dtb).

 

Flexcan2 bus is connected from imx6 as below

 

KEY_COL4 : CANTX

KEY_ROW4 : CANRX

 

And i use the SN65HVD252DR chip. and this is used in flexcan1(can0) and it works well.

I then attach the device tree files I modified(And my yocto version is : 3.10.53-r0).

 

After setting and applying to the board, I confirmed that there is 2094000.can under / sys / bus / platform / driver / flexcan.

On the board, I confirmed that can1 appears by inputting 'ip link set can1 up type can bitrate 500000'.

-------------------------------------------------------------------------------------------------------------------------------------

[ 1.447310] flexcan 2090000.can: device registered (reg_base=a09c0000, irq=142)
[ 1.453844] flexcan 2094000.can: device registered (reg_base=a09c8000, irq=143)
[ 3.268925] can: controller area network core (rev 20120528 abi 9)
[ 3.277091] can: raw protocol (rev 20120528)
[ 3.280086] can: broadcast manager protocol (rev 20120528 t)
[ 3.284480] can: netlink gateway (rev 20130117) max_hops=1
[ 4.457757] UBI: scanning is finished
[ 17.916512] flexcan 2090000.can can0: writing ctrl=0x032a2004
[ 27.247783] flexcan 2090000.can can0: writing ctrl=0x032aa054
[ 127.147736] flexcan 2090000.can can0: writing ctrl=0x032aa054
[ 257.746216] flexcan 2094000.can can1: writing ctrl=0x03292005
[ 582.606522] flexcan 2094000.can can1: writing ctrl=0x0329a055
[ 618.447320] flexcan 2094000.can can1: writing ctrl=0x0329a055
[ 1106.293894] flexcan 2094000.can can1: writing ctrl=0x0329a055
[ 1106.298849] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready

 

can1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:16 (16.0 B) TX bytes:0 (0.0 B)
Interrupt:143

-------------------------------------------------------------------------------------------------------------------------------------

 

After that, I tried to check can communication by using cansend on one board and candump on the other board.

However, it prints as follows and does not work. And it looks like there is no output from the pin.

-------------------------------------------------------------------------------------------------------------------------------------

interface = can1, family = 29, type = 3, proto = 1
write: No buffer space available

-------------------------------------------------------------------------------------------------------------------------------------

 

Please tell me where I made the mistake ;(

Outcomes