Code Monkey home page Code Monkey logo

radxa-zero-spi-display's Introduction

Radxa Zero SPI Display Driver Install

credits to: HejinYo for sharing the initial steps that can be found here.

I just made some updates, and added step to compile kernel for the displays

It should be able to support most of the available display drivers in the kernel. (Check the kernel directory for the available source)
We just need to modify compile and update into Radxa Zero.

Dependencies

# install dtc
sudo apt-get install device-tree-compiler

# optional / useful to test display
# framebuffer imageviewer
sudo apt-get install fbi

Create device tree files

# navigate to device tree path
# depends on your kernel version
cd /boot/dtbs/5.10.xx-x-amlogic-xxxxxxxxxxxxx/amlogic/overlay

# create new device tree file and 
# copy the contents of meson-g12a-spi-lcd.dts
# then configure pin assignment
sudo nano meson-g12a-spi-lcd.dts

# pin assignment, check values for A and B
<pin> = <0x2b A B>

# to get value of A, for example your pin is 36
# goto https://wiki.radxa.com/Zero/hardware/gpio
# get the ping number (Function 1 pin),
# ex. pin 36 -> GPIOH_8, then
# goto https://github.com/radxa/kernel/blob/linux-5.10.y-radxa-zero/include/dt-bindings/gpio/meson-g12a-gpio.h

# get the equivalent pin defined, for GPIOH_8, its 8, set it for A
# to get value of B, if it is initialized as HIGH, set to 1
# if initialized as LOW, set to 0

# save the dts file and compile to dtbo
# there may be some warnings, but its fine
sudo dtc -@ -I dts -O dtb -o meson-g12a-spi-lcd.dtbo meson-g12a-spi-lcd.dts

# update /boot/uEnv.txt
# add the new overlay to the overlays
# add the params
overlays=meson-g12a-spi-lcd
param_spidev_spi_bus=1
param_spidev_max_freq=10000000

# Compile the kernel, go to kernel-linux-5.10.y-radxa-zero/drivers/staging/fbtft/ directory
# if your display is st7789, you should take that .ko file
# be sure to change xxxx's to your own path
make && sudo cp {fb_st7789v.ko,fbtft.ko} /usr/lib/modules/5.10.xx-x-amlogic-xxxxxxxxxxxxx/kernel/drivers/staging/fbtft/


# lastly, reboot
sudo reboot now

# Connect the pins accordingly

# To verify the kernel is running
dmesg | grep fbtft

# to test display, get a sample image
sudo fbi -d /dev/fb1 -T 1 -noverbose -a <sample_image>

radxa-zero-spi-display's People

Contributors

markanthonyprado avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.