legacy:accessory:display:3.2inch_tft_touchscreen_shield:c4:start

How to Activate 3.2 Inch LCD Shield for ODROID-C4

It is recommended to update/upgrade your system using apt.

target
sudo apt update && sudo apt full-upgrade

SPI feature would be disabled by default.

You have to enable that feature using device-tree-compiler utility.

Please refer to this guide: https://wiki.odroid.com/odroid-c4/application_note/gpio/spi#tab__odroid-c4

And before proceeding, disable spidev node to avoid conflict.

target
sudo fdtput -t s /media/boot/meson64_odroidc4.dtb /soc/cbus@ffd00000/spi@13000/spidev@0 status "disabled"

To use its LCD comes with a touch screen, you have to enable those features in Device Tree Source.

target
sudo fdtput -t s /media/boot/meson64_odroidc4.dtb /soc/cbus@ffd00000/spi@13000/ads7846@1 status "okay"
sudo fdtput -t s /media/boot/meson64_odroidc4.dtb /soc/cbus@ffd00000/spi@13000/hktft32@0 status "okay"

Then reboot to apply changes.

target
reboot

After reboot, you will have a new framebuffer device named /dev/fb4.

target
ls /dev/fb*
# results
/dev/fb0  /dev/fb1  /dev/fb2  /dev/fb3  /dev/fb4

Find the framebuffer has name fb_hktft32. Commonly /dev/fb4 should be the frame buffer.

target
cat /sys/class/graphics/fb4/name
# results
fb_hktft32

To map between a console and a screen easily, installing fbset is recommended.

target
sudo apt install fbset

We will use con2fbmap utility that is coming with.

target
sudo con2fbmap
# results
Usage: con2fbmap console [framebuffer]

Let's map the console number 1 to the frame buffer 4 screen.

To do that, enter the following command.

target
sudo con2fbmap 1 4

Then, press Ctrl + Alt + F1 on your keyboard to change the current console to 1. Or, you can just enter the following command.

target
chvt 1

Then you can see the console on your LCD shield.

Map the console number 7, which is for X-Window though the Linux world, to the frame buffer 4, which is the LCD shield we've enabled.

To do that, enter the following command.

target
sudo con2fbmap 7 4

Then, press Ctrl + Alt + F7 on your keyboard to change the current console to 7. Or, you can just enter the following command.

target
chvt 7
  • legacy/accessory/display/3.2inch_tft_touchscreen_shield/c4/start.txt
  • Last modified: 2021/04/26 15:10
  • by joshua