hi everyone!
try to start MCP2515 on Nano Pi Neo Air, have next success:
Armbian 22.05.0-trunk Focal with Linux 5.15.33-sunxi
root@nanopiair:~# dmesg | grep spi
[ 1.965166] sun6i-spi 1c68000.spi: chipselect 0 already in use
[ 1.965202] spi_master spi0: spi_device register error /soc/spi@1c68000/spidev@0
[ 1.965257] spi_master spi0: Failed to create SPI device for /soc/spi@1c68000/spidev@0
[ 1.965550] sun8i-h3-pinctrl 1c20800.pinctrl: pin PA15 already requested by 1c28c00.serial; cannot claim for 1c69000.spi
[ 1.965580] sun8i-h3-pinctrl 1c20800.pinctrl: pin-15 (1c69000.spi) status -22
[ 1.965632] sun6i-spi 1c69000.spi: Error applying setting, reverse things back
[ 13.173316] mcp251x spi0.0 can0: MCP2515 successfully initialized.
root@nanopiair:~# dmesg | grep mcp
[ 13.173316] mcp251x spi0.0 can0: MCP2515 successfully initialized.
root@nanopiair:~# dmesg | fgrep -i can
[ 1.965550] sun8i-h3-pinctrl 1c20800.pinctrl: pin PA15 already requested by 1c28c00.serial; cannot claim for 1c69000.spi
[ 13.093230] CAN device driver interface
[ 13.173316] mcp251x spi0.0 can0: MCP2515 successfully initialized.
root@nanopiair:~# sudo ip link set can0 up type can bitrate 500000
root@nanopiair:~# ifconfig
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
but can data doesnt receive and send to other device.
this is my overlay
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
fragment@0 {
target-path = "/clocks";
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
can0_osc_fixed: can0_osc_fixed {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <40000000>;
};
};
};
fragment@1 {
target = <&pio>;
__overlay__ {
can0_pin_irq: can0_pin_irq {
pins = "PA2";
function = "irq";
drive = <0x0>;
pull = <0x1>;
linux,phandle = <0x1>;
phandle = <0x1>;
};
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
mcp2515 {
reg = <0>;
compatible = "microchip,mcp2515";
pinctrl-names = "default";
pinctrl-0 = <&can0_pin_irq>;
spi-max-frequency = <500000>;
interrupt-parent = <&pio>;
interrupts = <0 2 8>;
clocks = <&can0_osc_fixed>;
status = "okay";
};
};
};
};
this is my boot config
verbosity=1
bootlogo=false
console=serial
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=i2c0 spi-spidev usbhost2 usbhost3 w1-gpio
param_spidev_spi_bus=1
param_spidev_spi_cs=1
param_spidev_max_freq=1000000
rootdev=UUID=b159adca-200e-4061-b610-b41e2ca7e38e
rootfstype=ext4
user_overlays=sun8i-h3-i2s0-master spi-mcp251x
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
try to test loopback:
sudo ip link set can0 type can loopback on
cansend can0 001#1122334455667788
but command
candump can0
doesnt anwer me, just hold it tty. only CTRL+C breacked it.
Please help me to dig and solve problem.