maximilian fletkar Posted September 17 Share Posted September 17 Good afternoon everyone. Please help me with my problem. I have a Radha board zero 3w and I use the Armbian distrib. 24.8.1 . Everything works fine, except that I can't activate SPI. In the Armbian-config menu there is no hardware section (I tried different flash cards and Armbian versions, the problem persists), I also tried to edit the armbianEnv.txt and add overlays there, but I also did not have success. Tell me what else I can try. Activation works on the native distribution radxa debian. 0 Quote Link to comment Share on other sites More sharing options...
Werner Posted September 17 Share Posted September 17 Providing logs with armbianmonitor -u helps with troubleshooting and significantly raises chances that issue gets addressed. 0 Quote Link to comment Share on other sites More sharing options...
maximilian fletkar Posted September 17 Author Share Posted September 17 Ok! Thanks! https://paste.armbian.com/esecopulol 0 Quote Link to comment Share on other sites More sharing options...
Zokhoi Posted September 23 Share Posted September 23 (edited) Facing the same problem using kernel 6.1.75-vendor-rk35xx on trixie minimal. Trying to use SPI3 M1 CS0 with the overlay: /dts-v1/; /plugin/; / { fragment@0 { target = <&spi3>; __overlay__ { 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>; cs-gpios = <&gpio4 22 1>; max-freq = <20000000>; spidev@0 { compatible = "rockchip,spidev"; status = "okay"; reg = <0>; spi-max-frequency = <20000000>; }; }; }; }; results in: root@radxa-zero3:~# dmesg | grep spi [ 17.117658] rockchip-spi fe640000.spi: register misc device rkspi-dev3 [ 17.117691] rockchip-spi fe640000.spi: probed, poll=0, rsd=0, cs-inactive=0, ready=0 The same overlay works for Radxa debian bullseye xfce image with kernel 5.10.160-26-rk356x: root@radxa-zero3:~# dmesg | grep spi [ 18.371171] rockchip-spi fe640000.spi: probed, poll=0, rsd=0 Edited September 23 by Zokhoi 0 Quote Link to comment Share on other sites More sharing options...
maximilian fletkar Posted September 23 Author Share Posted September 23 Thanks for the answer, I wonder if it is possible to build an image of Armibian with kernel 5.10 and a version of Debian trixie? 0 Quote Link to comment Share on other sites More sharing options...
Zokhoi Posted September 23 Share Posted September 23 Legacy kernel is on 5.10, but it is deprecated and I have not tested it. 0 Quote Link to comment Share on other sites More sharing options...
maximilian fletkar Posted September 24 Author Share Posted September 24 Can explain how build debian using the armbian build system (./compile.sh) with a kernel 5.10? 0 Quote Link to comment Share on other sites More sharing options...
Werner Posted September 24 Share Posted September 24 Try adding legacy as kernel target to the board config of your desire and use BRANCH=legacy then. If something doesn't work you are on your own since this is not supported. 0 Quote Link to comment Share on other sites More sharing options...
Zokhoi Posted Monday at 11:24 AM Share Posted Monday at 11:24 AM Tested the overlay with legacy kernel 5.10.160-legacy-rk35xx on trixie minimal, can confirm the SPI works on this kernel. Currently driving an ST7796U (?) panel with a custom fbtft driver. 0 Quote Link to comment Share on other sites More sharing options...
maximilian fletkar Posted Monday at 12:02 PM Author Share Posted Monday at 12:02 PM (edited) Thank you very much for your answer! Can you post your image and driver? I also need to connect the display. And could you tell me what is the difference when using the display - to register your own dts file or custom fbtft driver Edited Monday at 12:12 PM by maximilian fletkar 0 Quote Link to comment Share on other sites More sharing options...
Zokhoi Posted Monday at 02:21 PM Share Posted Monday at 02:21 PM Here is my image. Well, dts files and dt overlay are files that specify the hardware on your board, and controls whether the kernel sees some of the pins as an interface like SPI. There are kernel drivers and userspace drivers, both of which requires the SPI to be activated in the device tree to work. The overlay I posted above activates spidev, which provides an SPI interface for the userspace to use, so something like Pimoroni ST7789 python library could communicate on the SPI on demand. fbtft is a kernel module that works with small SPI displays, like the ST7796U (?) panel that I have. In the overlay for fbtft, I have to specify settings for the display, so the system can recognize and initialize the panel at boot time. I needed a custom driver, as there is no ST7796 drivers in mainline kernel, and fbtft is not accepting new drivers anymore. You should check if there is an fbtft driver in the kernel for your panel that you can use right out of the box. Also the reason I put (?) after the ST7796U is that the store I bought the display from lists the panel as ST7796U, but when I try to use initialization sequence for ST7796 it didn't work. However I used the init sequence for ST7789 and it worked, but I still had to use ST7796's screen orientation settings, so I'm not sure which controller it actually is. Pins that I connected: MOSI: SPI3_MOSI_M1 / GPIO4_C3 / Pin 19 Clock: SPI3_CLK_M1 / GPIO4_C2 / Pin 23 Chip select: SPI3_CS0_M1 / GPIO4_C6 / Pin 24 Reset: GPIO3_B3 / Pin 29 Data/Command: GPIO3_B4 / Pin 31 Backlight: GPIO3_C3 / Pin 33 Overlay for ST7796 with fbtft: /dts-v1/; /plugin/; / { fragment@0 { target = <&spi3>; __overlay__ { 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>; cs-gpios = <&gpio4 22 1>; max-freq = <50000000>; st7796: panel@0 { compatible = "sitronix,st7796"; reg = <0>; status = "okay"; spi-max-frequency = <40000000>; dc-gpios = <&gpio3 12 0>; reset-gpios = <&gpio3 11 1>; led-gpios = <&gpio3 19 0>; rotate = <0>; bgr = <0>; width = <320>; height = <480>; fps = <60>; buswidth = <8>; // debug = <4000000>; }; }; }; }; 0 Quote Link to comment Share on other sites More sharing options...
maximilian fletkar Posted Tuesday at 05:13 AM Author Share Posted Tuesday at 05:13 AM Thank you very much. I have this display http://www.lcdwiki.com/4inch_HDMI_Display-C . It only processes touch via the SPI connector. As I understand it, I only need a dts file for XPT2046 Touch Screen Controller. 0 Quote Link to comment Share on other sites More sharing options...
Zokhoi Posted Tuesday at 11:51 AM Share Posted Tuesday at 11:51 AM You should look at the Linux documentation for XPT2046/ADS7846 , Raspberry Pi's ADS7846 overlay and goodtft's dtparams to see how to write the overlay then. 0 Quote Link to comment Share on other sites More sharing options...
maximilian fletkar Posted Wednesday at 04:19 PM Author Share Posted Wednesday at 04:19 PM (edited) Thanks for your help! I rewrote DTS using your links. But I still have a problem how to correctly indicate the name of the pin SPI? /dts-v1/; /plugin/; / { compatible = "rockchip,rk3566"; fragment@0 { target = <&spi3>; __overlay__ { status = "okay"; }; }; fragment@1 { target = <&gpio4>; __overlay__ { ads7846_pins: ads7846_pins { rockchip,pins = <5 12 0 &pcfg_pull_up>; }; }; }; fragment@2 { target = <&spi3>; __overlay__ { /* needed to avoid dtc warning */ #address-cells = <1>; #size-cells = <0>; ads7846: ads7846@1 { compatible = "ti,ads7846"; reg = <1>; spi-max-frequency = <2000000>; interrupts = <12 2>; // high-to-low edge triggered interrupt-parent = <&gpio5>; pendown-gpio = <&gpio4 12 0>; ti,x-plate-ohms = /bits/ 16 <60>; ti,pressure-max = /bits/ 16 <255>; }; }; }; }; Edited Wednesday at 05:08 PM by maximilian fletkar 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.