I am running Android 8.0 with canutils 4.0.6 and have configured dtsi and enabled flexcan in configs.
Installed a DB9 connector on J10 on both boards.
130|sabresd_6dq:/ # dmesg | grep can
[ 0.512749] i2c i2c-0: can't use DMA, using PIO instead.
[ 0.514015] i2c i2c-1: can't use DMA, using PIO instead.
[ 0.514823] i2c i2c-2: can't use DMA, using PIO instead.
[ 1.829804] vcan: Virtual CAN interface driver
[ 1.836707] flexcan 2090000.flexcan: gpr /soc/aips-bus@02000000/iomuxc-gpr@020e0000 req_gpr 0x34 req_bit 28 ack_gpr 0x10 ack_bit 17
[ 1.836767] flexcan 2090000.flexcan: device registered (reg_base=f82f8000, irq=33)
[ 4.021240] snvs-secvio 20cc000.caam-snvs: can't get snvs clock
[ 4.271788] can: controller area network core (rev 20120528 abi 9)
[ 4.279934] can: raw protocol (rev 20120528)
[ 4.282967] can: broadcast manager protocol (rev 20161123 t)
[ 4.287337] can: netlink gateway (rev 20130117) max_hops=1
[ 108.642749] flexcan 2090000.flexcan can0: writing ctrl=0x011a2003
[ 108.642763] flexcan 2090000.flexcan can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x011a2003
[ 108.642772] flexcan 2090000.flexcan can0: flexcan_chip_start: writing mcr=0x7de20209
[ 108.642780] flexcan 2090000.flexcan can0: flexcan_chip_start: writing ctrl=0x011a2053
[ 108.642840] flexcan 2090000.flexcan can0: flexcan_chip_start: reading mcr=0x64e20209 ctrl=0x011aac53
[ 108.642901] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 198.885852] flexcan 2090000.flexcan can0: New error state: 1
Loopback mode works fine with
ip link set can0 up type can bitrate 125000 loopback on
but when i use two sabre sd boards and send data on board 1 to board 2
Board1:
1|sabresd_6dq:/ # cansend can0 1F334455#1122334455667788
interface = can0, family = 29, type = 3, proto = 1
write: 1
write: 2
write: 3
write: 4
write: 5
write: 6
write: 7
write: 8
write: 9
write: 10
write: 11
write: 12
write: 13
Board2:
2|sabresd_6dq:/ # canecho can0 -v
interface-in = can0, interface-out = can0, family = 29, type = 3, proto = 1
Board1:
sabresd_6dq:/ # cat /proc/net/can/stats
366 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)
Board2:
sabresd_6dq:/ # cat /proc/net/can/stats
0 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)
Any help would be appreciated. do i have to use libsocketcan instead of canutils 4.0.6? also my linux kernel version is 4.9.17 . when i cross check with sabre AI code i see differences in flexcan.c drivers . does it mean my kernel is outdated and flexcan might not work between 2 i.mx6q sabre boards.
Hello,
I apologize for the delay.
Are you using our Android BSP? Since the Linux version for our Android 8.0 is 4.9.68.
Best regards,
Diego.