Skip to content

MCP251x failes setup CAN-bus communication with error=110 #4183

Closed

Description

@timok90

My project uses the mcp2515 chip to communicate via CAN-bus.
After kernel update following failure occurs:

~ $ dmesg | grep -i spi
[    7.567794] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset 
[    7.567855] mcp251x spi0.0: Probe failed, err=110
[    7.567948] mcp251x: probe of spi0.0 failed with error -110 

My overlay configuration is:

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25,spimaxfrequency=500000

My current kernel version is:
Linux 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux

os:
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"

and additionally I use the can-utils package.

Activity

  1. pelwell commented on Mar 4, 2021

    @pelwell
    Contributor

    This sounds like a hardware problem - have you double-checked all of your wiring?

  2. timok90 commented on Mar 15, 2021

    @timok90
    Author

    I've checked it but with no changes. Rework all the wiring helped. So, it was a wiring issue.

  3. Elhkiati2000 commented on Feb 16, 2024

    @Elhkiati2000

    I encountered the same error while attempting to use the mcp2515 chip for CAN-bus communication over SPI 1-0/1/2 on the RPi 3B+. Communication over SPI 0-0/1cs is successful using the "mcp2515-can0.dtbo" and "mcp2515-can1.dtbo" overlays. I've also successfully tested SPI 0 with the newly introduced overlay "mcp2515.dtbo" found in the Raspberry OS, which functions correctly. However, attempting to use the chip with SPI1-0/1/2cs results in the same error.

    Below is the description of the "mcp2515.dtbo" overlay located in /boot/overlays/README:

    Name:   mcp2515
    Info:   Configures the MCP2515 CAN controller on spi0/1/2
            For devices on spi1 or spi2, the interfaces should be enabled
            with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
    Load:   dtoverlay=mcp2515,<param>=<val>
            Params: spi<n>-<m>              Configure device at spi<n>, cs<m> (boolean, required)
            oscillator                                  Clock frequency for the CAN controller (Hz)
            speed                                       Maximum SPI frequence (Hz)
            interrupt                                  GPIO for interrupt signal
    
    • The connections are :

    INT -- 22 (GPIO 25)
    SCK -- 40 (GPIO 21 , SPI1 SCLK)
    SI -- 38 (GPIO 20 , SPI1 MOSI)
    SO -- 35 (GPIO 19 , SPI1 MISO)
    CS -- 36 (GPIO 16 , SPI1 CS2)
    GND -- 6 (GND)
    VCC - 1 (3V3)

    • The content of /boot/config.txt file is as follows :

    dtparam=spi=on
    dtoverlay=spi1-3cs,cs0_spidev=disabled,cs1_spidev=disabled
    dtoverlay=mcp2515,spi12=16,oscillator=16000000,speed=10000000,interrupt=25

    • The decompiled content of the "mcp2515.dtbo" file located in /boot/overlays, resulting in "mcp2515.dts", is as detailed below:

    `/dts-v1/;

    / {
    compatible = "brcm,bcm2835";

    fragment@0 {
    	target = <0xffffffff>;
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@1 {
    	target = <0xffffffff>;
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@2 {
    	target-path = "spi1/spidev@0";
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@3 {
    	target-path = "spi1/spidev@1";
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@4 {
    	target-path = "spi1/spidev@2";
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@5 {
    	target-path = "spi2/spidev@0";
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@6 {
    	target-path = "spi2/spidev@1";
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@7 {
    	target-path = "spi2/spidev@2";
    
    	__dormant__ {
    		status = "disabled";
    	};
    };
    
    fragment@8 {
    	target = <0xffffffff>;
    
    	__overlay__ {
    		mcp2515_pins {
    			brcm,pins = <0x19>;
    			brcm,function = <0x00>;
    			phandle = <0x01>;
    		};
    	};
    };
    
    fragment@9 {
    	target-path = "/clocks";
    
    	__overlay__ {
    		mcp2515-osc {
    			#clock-cells = <0x00>;
    			compatible = "fixed-clock";
    			clock-frequency = <0xf42400>;
    			phandle = <0x02>;
    		};
    	};
    };
    
    fragment@10 {
    	target = <0xffffffff>;
    	phandle = <0x03>;
    
    	__overlay__ {
    		status = "okay";
    		#address-cells = <0x01>;
    		#size-cells = <0x00>;
    
    		mcp2515@0 {
    			compatible = "microchip,mcp2515";
    			reg = <0x00>;
    			pinctrl-names = "default";
    			pinctrl-0 = <0x01>;
    			spi-max-frequency = <0x989680>;
    			interrupt-parent = <0xffffffff>;
    			interrupts = <0x19 0x08>;
    			clocks = <0x02>;
    			phandle = <0x04>;
    		};
    	};
    };
    
    __overrides__ {
    	spi0-0 = [00 00 00 00 2b 30 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 30 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 30 5f 30 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 30 2d 30 2d 6f 73 63 00];
    	spi0-1 = [00 00 00 00 2b 31 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 31 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 30 5f 31 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 30 2d 31 2d 6f 73 63 00];
    	spi1-0 = [00 00 00 00 2b 32 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 30 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 31 5f 30 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 31 2d 30 2d 6f 73 63 00];
    	spi1-1 = [00 00 00 00 2b 33 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 31 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 31 5f 31 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 31 2d 31 2d 6f 73 63 00];
    	spi1-2 = [00 00 00 00 2b 34 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 32 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 31 5f 32 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 31 2d 32 2d 6f 73 63 00];
    	spi2-0 = [00 00 00 00 2b 35 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 30 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 32 5f 30 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 32 2d 30 2d 6f 73 63 00];
    	spi2-1 = [00 00 00 00 2b 36 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 31 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 32 5f 31 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 32 2d 31 2d 6f 73 63 00];
    	spi2-2 = [00 00 00 00 2b 37 00 00 00 00 03 74 61 72 67 65 74 3a 30 3d 00 ff ff ff ff 00 00 00 04 72 65 67 3a 30 3d 32 00 00 00 00 01 6e 61 6d 65 3d 6d 63 70 32 35 31 35 5f 73 70 69 32 5f 32 5f 70 69 6e 73 00 00 00 00 02 6e 61 6d 65 3d 6d 63 70 32 35 31 35 2d 73 70 69 32 2d 32 2d 6f 73 63 00];
    	oscillator = [00 00 00 02 63 6c 6f 63 6b 2d 66 72 65 71 75 65 6e 63 79 3a 30 00];
    	speed = <0x04 0x7370692d 0x6d61782d 0x66726571 0x75656e63 0x793a3000>;
    	interrupt = [00 00 00 01 62 72 63 6d 2c 70 69 6e 73 3a 30 00 00 00 00 04 69 6e 74 65 72 72 75 70 74 73 3a 30 00];
    };
    
    __symbols__ {
    	mcp2515_pins = "/fragment@8/__overlay__/mcp2515_pins";
    	clk_mcp2515_osc = "/fragment@9/__overlay__/mcp2515-osc";
    	mcp2515_frag = "/fragment@10";
    	mcp2515 = "/fragment@10/__overlay__/mcp2515@0";
    };
    
    __fixups__ {
    	spidev0 = "/fragment@0:target:0";
    	spidev1 = "/fragment@1:target:0";
    	gpio = "/fragment@8:target:0\0/fragment@10/__overlay__/mcp2515@0:interrupt-parent:0";
    	spi0 = "/fragment@10:target:0\0/__overrides__:spi0-0:21\0/__overrides__:spi0-1:21";
    	spi1 = "/__overrides__:spi1-0:21\0/__overrides__:spi1-1:21\0/__overrides__:spi1-2:21";
    	spi2 = "/__overrides__:spi2-0:21\0/__overrides__:spi2-1:21\0/__overrides__:spi2-2:21";
    };
    
    __local_fixups__ {
    
    	fragment@10 {
    		__overlay__ {
    			mcp2515@0 {
    				pinctrl-0 = <0x00>;
    				clocks = <0x00>;
    			};
    		};
    	};
    
    	__overrides__ {
    		spi0-0 = <0x07 0x19 0x25 0x42>;
    		spi0-1 = <0x07 0x19 0x25 0x42>;
    		spi1-0 = <0x07 0x19 0x25 0x42>;
    		spi1-1 = <0x07 0x19 0x25 0x42>;
    		spi1-2 = <0x07 0x19 0x25 0x42>;
    		spi2-0 = <0x07 0x19 0x25 0x42>;
    		spi2-1 = <0x07 0x19 0x25 0x42>;
    		spi2-2 = <0x07 0x19 0x25 0x42>;
    		oscillator = <0x00>;
    		speed = <0x00>;
    		interrupt = <0x00 0x10>;
    	};
    };
    

    };
    `
    Additionally, I've tested the "mcp2515-can2-overlay.dtbo" and "mcp2515-can0-1.dtbo" overlays mentioned in issue #1804 , which resulted in the same error. I've double-checked the wiring, and it appears to be correct. Can someone assist?

  4. gea231 commented on Oct 29, 2025

    @gea231

    hey to all i encounter the same issue
    mesg | grep spi1
    [ 3.624237] mcp251x spi1.2: MCP251x didn't enter in conf mode after reset
    [ 3.624264] mcp251x spi1.2: Probe failed, err=110
    [ 3.624267] mcp251x spi1.2: probe with driver mcp251x failed with error -110
    [ 4.636669] mcp251x spi1.1: MCP251x didn't enter in conf mode after reset
    [ 4.636740] mcp251x spi1.1: Probe failed, err=110
    [ 4.636745] mcp251x spi1.1: probe with driver mcp251x failed with error -110

    i have one 2ch can hat+ and my connection is that i attached the CAN hat+ with raspberry pi cm5 IOboard
    i have one CAN so I attached CAN_0H with CAN_1H CAN_0L with CAN_1L and the jumper is 3V3 i follow the step that mentioned https://www.waveshare.com/wiki/2-CH_CAN_HAT+#32-bit_Raspberry_Pi_System but at the end i received this error i noticed there is written is hardware error how i can resolved this error kindly let me know can you anyone tell me how i can resolved this issue

  5. gea231 commented on Oct 29, 2025

    @gea231

    Image
    i used Type C USB to give power before i give external power that why there is two wire in can hat+ so ignore this wire if there is any confusion in the pic i can connect the CANH with CANH and CANL with CANL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions