flexcan can't send/receive message in fd mode

cancel
Showing results for 
Search instead for 
Did you mean: 

flexcan can't send/receive message in fd mode

Jump to solution
131 Views
tam_do
Contributor I

Dear all,

 

I'm testing dual Flexcan on custom board of iMX8MP on Linux flexcan.c driver:

I was connected can0 and can1 together, and when testing on classical CAN mode, it worked (message is sent/received on can0 and can1), but it did not work on FD CAN mode.

- Classical CAN mode:

# ip link set can0 type can bitrate 100000

# ip link set can0 up

# ip link set can1 type can bitrate 100000

# ip link set can1 up

 

// send message using can-utils tool

# candump can1 > can1.log & 

cansend can0 123#1122334455667788

# cat can1.log // it should have data

can1 123 [8] 11 22 33 44 55 66 77 88

 - FD CAN mode:

# ip link set can0 type can bitrate 500000 dbitrate 2000000 fd on

# ip link set can0 up

# ip link set can1 type can bitrate 500000 dbitrate 2000000 fd on

# ip link set can1 up

 

// send random canfd_frame

# cangen can0 -f -v
can0 2A0##0.D0.7B.E8
can0 4E4##0.E4.92.7B.37.38.35.17.4C.E4.92.7B.37.38.35.17.4C.E4.92.7B.37
can0 7DD##0.D6.24.EF.0A.B9.50.16.62.D6.24.EF.0A.B9.50.16.62.D6.24.EF.0A
can0 2CD##0
can0 66B##0.41.23
can0 0C3##0.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67.76.CD.5C.55.09.88.97.67
can0 335##0.CA.31.4E.47.57.FC.DD.5F.CA.31.4E.47
can0 190##0.F2.84.EA.09.30.4C.FC.38.F2.84.EA.09.30.4C.FC.38.F2.84.EA.09.30.4C.FC.38.F2.84.EA.09.30.4C.FC.38.F2.84.EA.09.30.4C.FC.38.F2.84.EA.09.30.4C.FC.38
can0 662##0.8C.A1
can0 32E##0
can0 33C##0.C4.43.16.4D
write: No buffer space available

No message is sent/received on can0/can1 when turn on fd mode

# ip -s -d link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can <FD,FD-NON-ISO> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 25 prop-seg 37 phase-seg1 32 phase-seg2 10 sjw 1
flexcan: tseg1 2..96 tseg2 2..32 sjw 1..16 brp 1..1024 brp-inc 1
dbitrate 2000000 dsample-point 0.750
dtq 25 dprop-seg 7 dphase-seg1 7 dphase-seg2 5 dsjw 1
flexcan: dtseg1 2..39 dtseg2 2..8 dsjw 1..4 dbrp 1..1024 dbrp-inc 1
clock 40000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 1 0 0  

Status in /proc/net/can/stats:

# cat /proc/net/can/stats

11 transmitted frames (TXF)
0 received frames (RXF)
0 matched frames (RXMF)

0 % total match ratio (RXMR)
0 frames/s total tx rate (TXR)
0 frames/s total rx rate (RXR)

0 % current match ratio (CRXMR)
0 frames/s current tx rate (CTXR)
0 frames/s current rx rate (CRXR)

0 % max match ratio (MRXMR)
4 frames/s max tx rate (MTXR)
0 frames/s max rx rate (MRXR)

0 current receive list entries (CRCV)
0 maximum receive list entries (MRCV)

Issue is also same when testing EVK board.

Anybody, could you give me some suggestions to solve this issue, pls ?

BR,

Tamdo

0 Kudos
1 Solution
96 Views
jim_lin
NXP Employee
NXP Employee

Hi @tam_do 

 

the RM is a general description of the controller, but the enabled features depend on which part-number you pick, details can be found in the datasheet(captured below), FYR~

jim_lin_0-1614934186327.png

 

 

 

View solution in original post

0 Kudos
4 Replies
113 Views
jim_lin
NXP Employee
NXP Employee

it's commercial-grade i.MX8MP mounted on the EVK, according to the datasheet, it doesn't have CAN FD support(only CAN)

0 Kudos
105 Views
tam_do
Contributor I

Thank @jim_lin for reply.

Chapter 11.8 (FlexCAN) of  "iMX_8M_Plus_RM_RevC.pdf" mentioned FlexCAN module has supported  fully to CAN FD protocol.

By the way, could you tell me/us how to active it in our product (I guess that it will need to a pro-support)

tam_do_0-1614931321492.png

 

 

0 Kudos
97 Views
jim_lin
NXP Employee
NXP Employee

Hi @tam_do 

 

the RM is a general description of the controller, but the enabled features depend on which part-number you pick, details can be found in the datasheet(captured below), FYR~

jim_lin_0-1614934186327.png

 

 

 

View solution in original post

0 Kudos
92 Views
tam_do
Contributor I

Hi @jim_lin .

It's good information for me.Thanks for supporting !

Regard,

Tamdo

0 Kudos