Pier8283
Published © LGPL

Alternative Raspberry Pi board

For several months now, it has become impossible to buy a Raspberry Pi from official resellers, the alternative is Rock 4 SE

IntermediateProtip1 hour1,609
Alternative Raspberry Pi board

Things used in this project

Hardware components

Radxa Rock 4 SE
×1
Dual CAN BUS Shield for Raspberry
×1

Software apps and online services

Snappy Ubuntu Core
Snappy Ubuntu Core

Story

Read more

Code

mcp2515-can0-SG.dts

D
/* This devicetree overlay is INT pin 15 is GPIO4_C5 --> 4 A= 0, B = 1, C=2, D=3
* Pin is 4 C*8+5 ---> rockchip,pins = <4 21 0 &pcfg_pull_none>;
* Device tree overlay for mcp251x/can0
*/
/dts-v1/;
/plugin/;

/ {
        compatible = "rockchip,rockpi","rockchip,rk3399", "rockchip,rk3399-pinctrl";

        fragment@0 {
                target = <&pinctrl>;

                __overlay__ {
                        mcp2515_int_pin: mcp2515_int_pin {
                                rockchip,pins = <4 21 0 &pcfg_pull_none>;
                        };
                };
        };

        fragment@1 {
                target-path = "/";
                __overlay__ {
                        can_mcp2515_osc: can-mcp2515-osc {
                                compatible = "fixed-clock";
                                clock-frequency = <16000000>;
                                #clock-cells = <0>;
                        };
                };
        };

        fragment@2 {
                target = <&spi1>;

                __overlay__ {
                        status = "okay";
                        max-freq = <10000000>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        can_mcp2515: can-mcp2515@0 {
                                status = "okay";
                                compatible = "microchip,mcp2515";
                                reg = <0>;
                                interrupt-parent = <&gpio4>;
                                interrupts = <21 2>;
                                spi-max-frequency = <10000000>;
                                clocks = <&can_mcp2515_osc>;
                                vdd-supply = <&vcc3v3_sys>;
                                xceiver-supply = <&vcc3v3_sys>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&mcp2515_int_pin>;
                        };
                };
        };
};

Credits

Pier8283

Pier8283

10 projects • 5 followers

Comments