December 21, 20241 yr I'm trying to configure the CS (Chip Select) pin on my Orange Pi Zero 3. I added overlays=spi-spidev to the /boot/armbianEnv.txt file, created my own dtbo file, and tried all possible methods suggested by ChatGPT. I've been struggling for two weeks with no success. I haven't been able to switch the CE1 pin to alt4 state; it only stays off, nothing else. Is it even possible to work with SPI on this board?
December 21, 20241 yr Moved to the correct forum (community support). This is not a supported board. Adjusted the tag to reflect the correct board.
December 22, 20241 yr Author CLK, MOSI, MISO is work, but CS not work. In gpio readall : CLK1 - ALT4, MOSI1 - ALT4, MISO1-ALT4, but CE1 - OFF. How change mode CE1 to ALT4?
December 23, 20241 yr But maybe I found the mistake: In DT overlay of H616, some developer set spidev devices to compate with "rohm,dh2228fv", maybe he attached a DH2228FV DAC chip? change all of sun50i-h616-spi* dts files to `compatible = "armbian,spi-dev"; `
December 23, 20241 yr It seems the CS pin is not configured in the dts overlay . I tried to add them and failed.
December 23, 20241 yr Author i'm change all of sun50i-h616-spi* dts files to`compatible = "armbian,spi-dev" but nothing. CS is OFF! Maybe the reason is that it's called CE. In gpio readall CS is name CE.
December 24, 20241 yr Solution I modified the sun50i-h616-spidev1_1 dts file , it seems work. sun50i-h616-spidev1_1.dtbo sun50i-h616-spidev1_1.dtso sun50i-h616-spi-spidev.dtbo sun50i-h616-spi-spidev.dtso Edited December 24, 20241 yr by Guest add screen capture
December 24, 20241 yr Author It's working! Thank you so much, you've been a huge help. These challenges have really helped me understand device trees and hardware configuration. This forum is amazing! Edited December 24, 20241 yr by adif
December 26, 20241 yr 👍🏽 This is a problem with a specific dts meant for the spidev driver, because I am using the spi1 bus with 2 chip selects everyday with my LCD, which doesn’t use the spidev driver (uses dedicated LCD-spi driver). Do you have an older orange pi zero 3 Armbian image, and see if it works normally? can you rebuild Armbian with ./compile.sh, choose Linux edge (latest) and see if it works normally?
January 6, 20251 yr It is just a DTS error , not assign CS pin . I found it has fixed in Zero2W DTS file of 6.12 kernel , but not in other H616/618 boards
January 23, 20251 yr I am trying to get the SPI working on my orange-pi-zero3 (h618) to enable input shaping for my 3d printer. Hope I can get some pointers to get the SPI to work. Installed the following: Minimal/IOT images with Armbian Linux v6.6 Build Date: Jan 16, 2025 kernel: Linux 3dprinter 6.6.72-current-sunxi64 #1 SMP Fri Jan 17 12:36:27 UTC 2025 aarch64 GNU/Linux I tried to copy the .dtbo files ( from above) to the following location: -/boot/dtb-6.6.72-current-sunxi64/allwinner/overlay -/usr/lib/linux-image-6.6.72-current-sunxi64/allwinner/overlay -reboot ran armbian-config and enabled system->kernel->Manage device tree overlays->enabled sun50i-h616-spidev1_1 (nothing else) But I was unable to see a working spi port. This is the output of: :~$ dmesg | grep spi [ 1.367197] sun50i-h616-pinctrl 300b000.pinctrl: pin-64 (5010000.spi) status -517 [ 1.367215] sun6i-spi 5010000.spi: Error applying setting, reverse things back [ 1.377494] spi-nor spi0.0: supply vdd not found, using dummy regulator [ 1.392512] spi-nor spi0.0: spi-nor-generic (2048 Kbytes) lsmod | grep spi <nothing>
January 24, 20251 yr I don't know why you copied a dtbo to /usr/lib/linux-image... I think you only need spidev turned on in armbian-config What shows up in ls /dev/spi* ? Please show your success, if you make it work
January 24, 20251 yr >I think you only need spidev turned on in armbian-config This is what I did first, but could not find any ( in the /dev ) spi device. This triggered my to start searching for a solution and as far as I understand from this thread, there is a misconfiguration in the standard image. This is from the armbian website of the orange pi zero 3: Quote We have added overlays for i2c and uart. The spidev1_0 and spidev1_1 needs some editing and will be fixed in the future. Do you expect that in an image with an build Date of Jan 16, 2025 these fixes to get SPI to work are included? >I don't know why you copied a dtbo to /usr/lib/linux-image... Because I have very very basic understanding of the device tree. My thinking was, I do a sudo find -name *.dtbo -printf "%c %p\n" And see where the original files are ( that need to be changed). As I did not know what file are used during boot, I changed them both of them. I am still not really sure if you can replace these files on the sdcard and expect that they are used during boot. Is my expectation correct that I can just replace them on the sdcard and reboot, or do I need to rebuild and kernel/image ? What shows up in ls /dev/spi* ? /$ sudo ls /dev/spi* ls: cannot access '/dev/spi*': No such file or directory adif did get it to work and you can see that pin 24 if configured different. $ gpio readall +------+-----+----------+--------+---+ H616 +---+--------+----------+-----+------+ | GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO | +------+-----+----------+--------+---+----++----+---+--------+----------+-----+------+ | | | 3.3V | | | 1 || 2 | | | 5V | | | | 229 | 0 | SDA.3 | OFF | 0 | 3 || 4 | | | 5V | | | | 228 | 1 | SCL.3 | OFF | 0 | 5 || 6 | | | GND | | | | 73 | 2 | PC9 | ALT6 | 1 | 7 || 8 | 0 | OFF | TXD.5 | 3 | 226 | | | | GND | | | 9 || 10 | 0 | OFF | RXD.5 | 4 | 227 | | 70 | 5 | PC6 | ALT5 | 0 | 11 || 12 | 0 | OFF | PC11 | 6 | 75 | | 69 | 7 | PC5 | ALT5 | 0 | 13 || 14 | | | GND | | | | 72 | 8 | PC8 | OFF | 0 | 15 || 16 | 0 | OFF | PC15 | 9 | 79 | | | | 3.3V | | | 17 || 18 | 0 | OFF | PC14 | 10 | 78 | | 231 | 11 | MOSI.1 | OFF | 0 | 19 || 20 | | | GND | | | | 232 | 12 | MISO.1 | OFF | 0 | 21 || 22 | 0 | OFF | PC7 | 13 | 71 | | 230 | 14 | SCLK.1 | OFF | 0 | 23 || 24 | 0 | OFF | CE.1 | 15 | 233 | | | | GND | | | 25 || 26 | 0 | OFF | PC10 | 16 | 74 | | 65 | 17 | PC1 | OFF | 0 | 27 || 28 | 0 | ALT2 | PWM3 | 21 | 224 | | 272 | 18 | PI16 | ALT2 | 0 | 29 || 30 | 0 | ALT2 | PWM4 | 22 | 225 | | 262 | 19 | PI6 | OFF | 0 | 31 || 32 | | | | | | | 234 | 20 | PH10 | OFF | 0 | 33 || 34 | | | | | | +------+-----+----------+--------+---+----++----+---+--------+----------+-----+------+ | GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO | +------+-----+----------+--------+---+ H616 +---+--------+----------+-----+------+ Any tips that I can try ? Edited January 24, 20251 yr by swman
February 3, 20251 yr I managed to get the SPI to work. It is tested with the Minimal/IOT images with Armbian Linux v6.6 from the build date of end of January. I tried to copy the .dtbo files ( from above) to the following location: -/boot/dtb-6.6.72-current-sunxi64/allwinner/overlay The details can be found in the guide made by adif. 1. ls /dev > there is no spi 2. go to armbian-config What is spi* in orange pi zero3 ls /dev gpio readall 4. copy the .dtbo files ( from forum) to the following location -/boot/dtb-6.6.72-current-sunxi64/allwinner/overlay reboot gpio readall
June 22, 20251 yr Hello all Is anybody having success with spidev with orange pi zero 3 and Linux 6.12? I want to test my LCD panel's touch, but I need spidev working first
June 24, 20251 yr download all files attenmented . sudo cp *.dtbo /boot/dtb/allwinner/overlay open /boot/armbianEnv.txt , add this line: overlays=spi-spidev spidev1_1 and reboot, you should find and use /dev/spidev1.1 sun50i-h616-spidev1_0.dtbo sun50i-h616-spidev1_0.dtso sun50i-h616-spidev1_1.dtbo sun50i-h616-spidev1_1.dtso
June 25, 20251 yr Thank you! I will try it tomorrow. What is spi1_cs0_pin and spi1_cs1_pin equal to, in Orange Pi Zero 2W, and in Opiz3? Is it defined in the spi-spidev dtso, or in the main opiz3/opiz2w dts? I need to have it correctly in the main DTS, because the LCD driver doesn't use spidev (and it would conflict). cs0 matches the pin position in raspberry pi: pin 24.... so it would make sense if cs1 is pin 26. Reference. This is the patch that changes the opiz3/2w DTS https://forum.armbian.com/topic/50418-dont-use-kernel-61216-on-sunxi64/page/2/#findComment-216934
June 26, 20251 yr spi1-cs0-pin and etc are defined in .dtsi file , since they are physical pins of the H616/H618 chip. But they are assigned to different pins of 26-PIN and 40-PIN of Zero3 and zero2w
June 26, 20251 yr They are in the same pin numbers, but different GPIO Update: I found that I can just use both CS0 and CS1 in opiz3 normally as expected in a DTS for a SPI ili948x LCD and touch screen, as seen in my ili9488 thread. (PH9=CS0, PC10=CS1) I was having so much trouble before, but now I finally got it Edited June 29, 20251 yr by robertoj
July 19, 20251 yr follow the official instructions, change these dts to user overlay, simplicifed deployment just use `sudo make install` h616.tar.xz
August 22, 20251 yr H618 Orange Pi Zero2 – SPI/I2C/UART overlays not working after armbianEnv.txt edit I’m using Orange Pi Zero2 (H616) with Armbian. I edited /boot/armbianEnv.txt to enable SPI/I2C/UART, but GPIO pins for SPI/I2C/UART are not working. gpio readall shows OFF or wrong ALT modes. overlay_prefix=sun50i-h616 overlays=spi-spidev spidev1_1 uart5 i2c3-ph 229 SDA.3 ALT5 228 SCL.3 ALT5 231 MOSI.1 OFF 232 MISO.1 OFF 230 SCLK.1 OFF ... sun50i-h616-bananapi-m4-spi1-cs0-cs1-spidev.dtbo sun50i-h616-bananapi-m4-spi1-cs0-spidev.dtbo sun50i-h616-bananapi-m4-spi1-cs1-spidev.dtbo sun50i-h616-i2c3-ph.dtbo sun50i-h616-uart5.dtbo ... Copy dtbo to /boot/dtb/allwinner/overlay/ Reboot Which overlays are correct for SPI/I2C/UART on H616? How to check if dtbo is actually loaded? If copying dtbo doesn’t help, what should I do? Thanks!
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.