0
goodwinsis

Orange pi Zero + MCP2515

Recommended Posts

HI, guys. i need help, with my orange pi zero + mpc2515.

My connect, is the same as this image.

Int connect to PA7.

orange-pi-zero-pinout.jpg

 

 

 

 

mcp-2515.dtbo:

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "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  = <8000000>;
            };
        };
    };

    fragment@1 {
        target = <&pio>;
        __overlay__ {
            can0_pin_irq: can0_pin_irq {
                pins = "PA7";
                function = "irq";
                bias-pull-up;
            };
        };
    };

    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 = <10000000>;
                interrupt-parent = <&pio>;
                interrupts = <0 7 2>; /* PA7 IRQ_TYPE_EDGE_FALLING */
                clocks = <&can0_osc_fixed>;
                status = "okay";
            };
        };
    };
};

 

 

 

 

 

dmesg | grep spi
[    3.311923] sun6i-spi 1c68000.spi: chipselect 0 already in use
[    3.311943] spi_master spi0: spi_device register error /soc/spi@1c68000/flash@0
[    3.311964] spi_master spi0: Failed to create SPI device for /soc/spi@1c68000/flash@0
[   12.137229] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset
[   12.139207] mcp251x spi0.0: Probe failed, err=16
[   12.139292] mcp251x: probe of spi0.0 failed with error -16

 

 

I try change  

Quote

target = <&spi0>;  ----> target = <&spi1>;

this is solution not work.

 

Thank you in advance for your help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0