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

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

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

Jump to solution
1,149 Views
p01049199539
Contributor II

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 ;(

Labels (4)
1 Solution
994 Views
igorpadykov
NXP Employee
NXP Employee

Hi Seung

for flexcan2 configuration one can look at Sabre AI board

imx6qdl-sabreauto.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Also may be useful to check with oscilloscope state of SN65HVD252DR pin "S"

so it was not in stby state.

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

View solution in original post

2 Replies
995 Views
igorpadykov
NXP Employee
NXP Employee

Hi Seung

for flexcan2 configuration one can look at Sabre AI board

imx6qdl-sabreauto.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Also may be useful to check with oscilloscope state of SN65HVD252DR pin "S"

so it was not in stby state.

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

995 Views
p01049199539
Contributor II

Hi igorpadykov

Thank you for your kind reply.

The dts file you attached was helpful to me !.

I confirmed the normal operation of flexcan2.
(TX and RX works normally!)

Since my colleague will solve the H / W problem, I am satisfied with this.

0 Kudos