Jump to content

8p8c

Validating
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi all, LONG POST WARNING!!! I have been trying to get an SPI TFT screen to work with the OPI Zero 3. To that end, the first goal was to get SPI output confirmed working on physical pins 19, 21, 23 and 24. I have compiled 6.7.10-edge-sunxi64 from the build environment. The actual board is gold screen printed as a "Waveshare Spotpear 3.2" which may well be a clone, as the chipset is marked HR2046, i.e. an XPT2046 -ish which is, possibly a clone of the TI ADS7846, some or all of this sentence may be incorrect. To get the overlays to display in armbian-config it is required to name the overlays with the chipset prefix - i.e. for Opi Zero 3, this would be sun50i-h616-myoverlay.dtbo - bearing in mind the chipset for the zero 3 is actually h618, but I am aware discussions are ongoing as is the work, for which many thanks. 6.x Kernel SPI on H618: https://docs.armbian.com/Developer-Guide_Build-Preparation/ This allows compilation for the Zero 3: ./compile EXPERT=”yes” Remember to select the drivers for TFT displays in the config, I say this (not remembering exactly where they are buried) because it may be the case that they cannot be easily added after the fact - don't shoot me - I read it somewhere in my travels plus it was easier for me. Alter and compile the chosen DTS files to DTBO Set up the ENV and copy the DTBO files to the device. If activated overlays have parameters marked as “Required”, those parameters have to be set to proper values U-boot does not support overlay parameters, so changing values is implemented via executing a "fixup" script after all overlays were applied. This script uses environment variables loaded from /boot/armbianEnv.txt to change the live tree using fdt command. How to work out the numbers: // Select pins: 1st number = pos. of letter in the alphabet - 1 // 2nd number = pin number // 3rd number = DON'T CHANGE! (1 = ACTIVE_LOW, 0 = ACTIVE_HIGH) // Example: PA2 = <&pio 0 2 1> // PC7 = <&pio 2 7 0> The dtc is used to decompile/recomple the DTS to DTBO and vice versa, the exception being user created overlays, it is fully documented so not repeated here, this can be added via the "sudo armbian-add-overlay" command - which compiles and places .dts files into /boot/overlay-user/ Documentation is here: https://docs.armbian.com/User-Guide_Allwinner_overlays/ https://docs.armbian.com/Hardware_Allwinner/ https://github.com/armbian/sunxi-DT-overlays https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/devicetree/bindings/input/touchscreen/ads7846.txt https://github.com/rm-hull/spidev-test is invaluable for testing. The following commands have also proved useful: sudo /bin/bash -c "cat /sys/kernel/debug/pinctrl/*/pinmux-pins" sudo cat /sys/kernel/debug/gpio I also downloaded and installed the Orangepi wiringOP: Download the code of wiringOP orangepi@orangepi:~$ sudo apt update orangepi@orangepi:~$ sudo apt install -y git orangepi@orangepi:~$ git clone https://github.com/orangepi-xunlong/wiringOP.git -b next Note that the source code needs to download the code of the wiringOP next branch, please don't miss the -b next parameter. According to initial loopback testing before adding my own overlays (apply a jumper between MISO and MOSI) , via "sudo ./spidev_test -v -D /dev/spidev1.0" - this interface is functioning as expected. The Opi Zero 3 seems to have two SPI busses, and the devices on said bus need to be targeted correctly (0 or 1) hence what I think is correct, which is to add a CS (chipselect) overlay. Results of gpio readall (screenshot as copy paste mucks up the formatting): Next step was to add the dtbo files and activate via armbianEnv.txt verbosity=1 bootlogo=true console=both disp_mode=1920x1080p60 overlay_prefix=sun50i-h616 overlays=spi-ads7846 spi-double-spidev-cs spi-spidev param_spidev_spi_bus=1 param_spidev_cs=0 rootdev=UUID=22c98ce5-14a8-483f-b440-35690209c856 rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u I have added my own dtbo files modified from the ones in https://github.com/armbian/sunxi-DT-overlays - which are attached. The error I am getting appears to be interrupt related, so my question is - how are the interrupts assigned, or more directly what do I put in place of PA7 which appears to be the issue the first three errors notwithstanding as I believe from reading about other OrangePi devices, the board .dtb may need looking at? dmesg | grep spi [ 1.840708] sun6i-spi 5010000.spi: Error applying setting, reverse things back [ 1.840994] sun6i-spi 5011000.spi: Error applying setting, reverse things back [ 1.849460] sun6i-spi 5010000.spi: Error applying setting, reverse things back [ 1.857263] spi-nor spi0.0: supply vdd not found, using dummy regulator [ 1.872754] spi-nor spi0.0: spi-nor-generic (16384 Kbytes) [ 7.127377] SPI driver ads7846 has no spi_device_id for ti,tsc2046 [ 7.127404] SPI driver ads7846 has no spi_device_id for ti,ads7843 [ 7.127409] SPI driver ads7846 has no spi_device_id for ti,ads7845 [ 7.127413] SPI driver ads7846 has no spi_device_id for ti,ads7873 [ 7.132367] sun50i-h616-pinctrl 300b000.pinctrl: pin PA7 already requested by spi1.0; cannot claim for 300b000.pinctrl:7 [ 7.132399] ads7846 spi1.0: failed to request pendown GPIO [ 7.132405] ads7846: probe of spi1.0 failed with error -22 There also seems to be a bit of a debate about the <compatible> tag and what should or should not be in it. I am fast approaching the end of my knowledge on this, as this is a first post, please be gentle! This is an attempt to document the fact that due diligence has been applied as much as possible, it might help others, and if nothing else, it has imbued me with admiration for those who have got this board to the state of functionality that we can enjoy today. If anything is hideously wrong, please guide (gently) as I know there are people here who have far greater detailed knowledge than I. Main takeaway - SPI works - needs tweaking, help and guidance appreciated. sun50i-h616-spi-double-spidev-cs.dts sun50i-h616-spi-ads7846.dts
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines