How to Activate 3.2 Inch LCD Shield for ODROID-N2

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

root@odroid:~# apt update
root@odroid:~# apt full-upgrade -y

Enable SPI Driver

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-n2/application_note/gpio/spi#n2

Enable ADS7846 Touch Driver

To use its touch screen, you have to enable that feature in Device Tree Source.

Assume that you've installed device-tree-compiler. Enter the following commands.

root@odroid:~# fdtput -t s /media/boot/meson64_odroidn2.dtb /soc/cbus@ffd00000/spi@13000/ads7846@1 status okay

Then reboot to apply changes.

root@odroid:~# reboot

Insert a Module

You should load a module designed for our LCD shield.

root@odroid:~# modprobe fbtft_device name=odroid32 rotate=90

Then you will have a new framebuffer device /dev/fbX.

root@odroid:~# ls /dev/fb*
/dev/fb0  /dev/fb1  /dev/fb2  /dev/fb3  /dev/fb4

Find the framebuffer has name fb_ili9340. Commonly /dev/fb4 should be that.

root@odroid:~# cat /sys/class/graphics/fb4/name
fb_ili9340

The character X depends on your system environment. Replace X to yours.

Install fbset Utility

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

root@odroid:~# apt install fbset

We will use con2fbmap utility that is coming with.

root@odroid:~# con2fbmap
 
Usage: con2fbmap console [framebuffer]

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

To do that, enter the following command.

root@odroid:~# 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.

root@odroid:~# 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.

root@odroid:~# 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.

root@odroid:~# chvt 7