Hi
I’m using Colibri iMX6 Solo 256MB module in combination with the Colibri Evaluation Carrier Board. I have build kernel and rootfs using Yocto and “bitbake -k console-tdx-image” and repository toradex-bsp-platform and branch LinuxImageV2.7. The HW is up and running and now I try to use CAN using MCP2515 (will later switch to the build-in CAN module). I think that I’m unable to get it up and running correctly.
I have tried to follow the guide here without success: https://developer.toradex.com/knowledge-base/can-(linux)
At boot I can’t see the MCP2515 driver getting loaded like “mcp251x spi3.0: probed”. Some other CAN and SPI related things are still there:
[ 1.164641] spi_imx 2014000.ecspi: probed
[ 1.171547] vcan: Virtual CAN interface driver
[ 1.178032] CAN device driver interface
[ 1.183944] spi3.0 supply vdd not found, using dummy regulator
[ 1.191762] spi3.0 supply xceiver not found, using dummy regulator
...
[ 2.184205] can: controller area network core (rev 20120528 abi 9)
[ 2.192296] NET: Registered protocol family 29
[ 2.198696] can: raw protocol (rev 20120528)
[ 2.204898] can: broadcast manager protocol (rev 20120528 t)
[ 2.212469] can: netlink gateway (rev 20130117) max_hops=1
The driver might be there?
root@colibri-imx6:~# zcat /proc/config.gz | grep CONFIG_CAN_MCP251X
CONFIG_CAN_MCP251X=y
Try to start can0, the second command gives no reply
root@colibri-imx6:~# ip link set can0 type can bitrate 250000
root@colibri-imx6:~# ifconfig can0 up
root@colibri-imx6:~# ip -details link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE restart-ms 0
bitrate 250000 sample-point 0.875
tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000numtxqueues 1 numrxqueues 1
root@colibri-imx6:~# cat /proc/interrupts | grep mcp251x
130: 0 gpio-mxc 27 Edge mcp251x
root@colibri-imx6:~# ip addr
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN group default qlen 10
link/can
I looked at the device tree file, ./tmp-glibc/work-shared/colibri-imx6/kernel-source/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts, and found this.
&ecspi4 {
status = "okay";
mcp258x0: mcp258x@1 {
compatible = "microchip,mcp2515";
reg = <0>;
clocks = <&clk16m>;
interrupt-parent = <&gpio3>;
interrupts = <27 0x2>;
spi-max-frequency = <10000000>;
status = "okay";
};
spidev0: spidev@1 {
compatible = "toradex,evalspi";
reg = <0>;
spi-max-frequency = <23000000>;
status = "disabled";
};
};
According to the link above it should be can0:can@1, so I changed that, rebuild kernel and images (“bitbake -f -c compile virtual/kernel” and “bitbake -k console-tdx-image”) and used the new uImage, dtb-file and rootfs. No change.
- What is “mcp258x0: mcp258x@1” stand for? Is this right?
- What is wrong with my setup?