We are using LS1028A-RDB and LSDK 20.04. On board CAN channel is not receiving any data nor sending the same. We are using Vector CAN4 to send and receive data to EVM.
In Linux: using "ifconfig", CAN channel is visible. We installed CAN application from "can-utils". But no messages were received in "candump" and no messages were sent in "cansend" commands.
In "dmsg", We found "CAN module Xceiver not present" error.
If We probe at Tx and Rx pins of LS1028A, Rx line is receiving some data which is sent from Vector CAN4. But Bus Master is showing "Bus Error" and Error packet is been seen in CAN BUS. Tx remains idle.
In LSDK2004 default Linux Kernel configuration file flexcan driver is configured as Kernel module. Please configure Linux Kernel with "CONFIG_CAN_FLEXCAN=y", then rebuild Linux Kernel image. Please refer to the attached Linux Kernel configuration file.
Please refer to the following loopback test on LS1028ARDB.
oot@localhost:~# zcat /proc/config.gz | grep -i flexcan CONFIG_CAN_FLEXCAN=y root@localhost:~# echo '7 4 1 7' > /proc/sys/kernel/printk root@localhost:~# echo $? 0 root@localhost:~# ifconfig can0 down root@localhost:~# ip link set can0 up type can bitrate 125000 loopback on root@localhost:~[ 50.574113] 001: IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready # cat /proc/interrupts |grep can0 12: 0 0 GICv3 53 Level can0 root@localhost:~# candump can0 & [1] 1680 root@localhost:~# echo ' SENSORCAN="can0" > (1234567890.223344) can0 123#1122 > (1234567890.223380) can0 123#2223 > (1234567890.223400) can0 123#3323 > (1234567890.223420) can0 123#4423 > (1234567890.223460) can0 123#5523 > '> can0data.txt root@localhost:~# root@localhost:~# echo $? 0 root@localhost:~# cat can0data.txt SENSORCAN="can0" (1234567890.223344) can0 123#1122 (1234567890.223380) can0 123#2223 (1234567890.223400) can0 123#3323 (1234567890.223420) can0 123#4423 (1234567890.223460) can0 123#5523 root@localhost:~# canplayer -I can0data.txt can0 123 [2] 11 22 can0 123 [2] 11 22 can0 123 [2] 22 23 can0 123 [2] 22 23 can0 123 [2] 33 23 can0 123 [2] 33 23 can0 123 [2] 44 23 can0 123 [2] 44 23 can0 123 [2] 55 23 can0 123 [2] 55 23 root@localhost:~# cat /proc/interrupts |grep can0 12: 6 0 GICv3 53 Level can0 root@localhost:~# ip -details -statistics link show can0 2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10 link/can promiscuity 0 can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 bitrate 125000 sample-point 0.875 tq 100 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 flexcan: dtseg1 2..39 dtseg2 2..8 dsjw 1..4 dbrp 1..1024 dbrp-inc 1 clock 200000000 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 20 10 0 0 0 0 TX: bytes packets errors dropped carrier collsns 10 5 0 0 0 0
Thanks for reply. @yipingwang
We are getting "CONFIG_CAN_FLEXCAN=m" (Attached screenshot)
We manually updated below lines in configuration file in location "/packages/linux/linux/arch/arm64/configs/defconfig.txt"
1. CONFIG_CAN=y
2. CONFIG_CAN_FLEXCAN=y
After cleaning, building and packing the linux using below commands
flex-builder –c clean-linux
flex-builder -c linux -a arm64
flex-builder -i mkbootpartition -a arm64
The configuration is set as "m" but We updated to "y". Can you say the procedure to make it "y" ?
Please go to folder ~/flexbuild_lsdk2012/build/linux/linux/arm64/LS/output/LSDK-20.12-V5.4 and run the following command, please configure CONFIG_CAN_FLEXCAN=y.
$make ARCH=arm64 menuconfig
Then go to ~/flexbuild_lsdk2012 run the following command.
$ flex-builder -c linux -a arm64