Zero 3W here with the default Radxa OS. I’m trying to control two SSD1351 OLED displays both connected to SPI 3, each display with their own CS line (pin 36 and pin 40).
I’ve had this setup working well on a Raspberry Pi Zero 2W and am trying to move over to Radxa instead.
I’ve downloaded radxa-overlays and modified the file rk3568-spi3-m1-cs0-spidev.dts to enable both SPI interfaces with differing CS lines:
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
/ {
metadata {
title = "Enable spidev on SPI3-M1 over CS0";
compatible = "radxa,rock-3a", "radxa,rock-3b", "radxa,rock-3c", "radxa,zero3";
category = "misc";
exclusive = "GPIO4_C2", "GPIO4_C3", "GPIO4_C5", "GPIO3_A7", "GPIO3_A5";
description = "Enable spidev on SPI3-M1 over CS0 CS1.";
};
};
&spi3 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default", "high_speed";
pinctrl-0 = <&spi3m1_cs0 &spi3m1_pins>;
pinctrl-1 = <&spi3m1_cs0 &spi3m1_pins_hs>;
max-freq = <50000000>;
spidev@0 {
compatible = "rockchip,spidev";
status = "okay";
reg = <0>;
cs-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>; // GPIO3_A7 = GPIO15 = pin 36
spi-max-frequency = <50000000>;
};
spidev@1 {
compatible = "rockchip,spidev";
reg = <1>;
spi-max-frequency = <50000000>;
cs-gpios = <&gpio3 13 GPIO_ACTIVE_LOW>; // GPIO3_A5 = GPIO13 = pin 40
status = "okay";
};
};
Currently I see both SPI devices in /dev spidev3.0 and spidev3.1, and I see data+clk being outputted on an oscilloscope. But when I test the CS pins, they are not being activated when SPI is active and writing out to either of the displays.
I have a 1k pull-down resistor on both CS GPIOs.
Any help tracking down how to debug this would be appreciated.