Quantcast
Viewing all articles
Browse latest Browse all 4933

Interfacing (DSI, CSI, I2C, etc.) • sc16is752 (WAVESHARE 2 channel RS485 board) failing on spi4 instead of SPI1

I am trying to bring up a sc16is752 (WAVESHARE 2 channel RS485 board) on spi4 instead of SPI1 (pins 4,5,6,7 - ALT3 with interrupt on pin 17) on a CM4.

I have created and compiled a DTS, but it will not load. I am new to devise trees, and so I am muddling along. I worry that it is not compatible with SPI4 since the specs say spi4 is bcm2711 only compatible. ANY help is greatly appreciated.

loading with:
sudo dtoverlay -v sc16is752-spi4

The message I receive is:
DTOVERLAY[debug]: using platform 'bcm2711'
DTOVERLAY[debug]: overlay map loaded
run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre
DTOVERLAY[debug]: loading file '/boot/firmware/overlays/sc16is752-spi4.dtbo'
DTOVERLAY[debug]: wrote 1619 bytes to '/tmp/.dtoverlays/0_sc16is752-spi4.dtbo'
DTOVERLAY[debug]: wrote 1619 bytes to '/sys/kernel/config/device-tree/overlays/0_sc16is752-spi4/dtbo'
* Failed to apply overlay '0_sc16is752-spi4' (kernel)
run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post


compiling with:
sudo dtc -@ -O dtb -o sc16is752-spi4.dtbo sc16is752-spi4.dts

---- dt16is752_spi5.dts -----

/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835", "brcm,bcm2711", "brcm,bcm2708", "brcm,bcm2709";

fragment@0 {
target = <&gpio>;
__overlay__ {
spi4_pins: spi4_pins {
brcm,pins = <5 6 7>;
brcm,function = <3>; /* alt4 */
};

spi4_cs_pins: spi4_cs_pins {
brcm,pins = <4>;
brcm,function = <1>; /* output */
};
};
};

fragment@1 {
target = <&spi4>;
frag1: __overlay__ {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi4_pins &spi4_cs_pins>;
cs-gpios = <&gpio 4 1>;
status = "okay";

sc16is752: sc16is752@0 {
compatible = "nxp,sc16is752";
reg = <0>; /* CE0 */
clocks = <&sc16is752_clk>;
interrupt-parent = <&gpio>;
interrupts = <17 2>; /* IRQ_TYPE_EDGE_FALLING */
#gpio-controller;
#gpio-cells = <2>;
spi-max-frequency = <4000000>;

sc16is752_clk: sc16is752_clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <14745600>;
};
};
};
};

fragment@2 {
target = <&aux>;
__overlay__ {
status = "okay";
};
};

__overrides__ {
int_pin = <&sc16is752>,"interrupts:0";
};
};

Statistics: Posted by mhaines4102 — Fri Jan 10, 2025 12:05 am



Viewing all articles
Browse latest Browse all 4933

Trending Articles