0
arhi

orangepi one and ili9340

Recommended Posts

I started first with orangepi pc2 (H5)  but now trying the same thing on orangepi one (h3) -

 

trying to make ili9340 module work

 

it works flawlesly on rpi with raspbian so the hw module works (and the fb_ili9340 module in kernel talks to it properly)

debug info I pulled from rpi


 

pi@octopi:~ $ uname -a
Linux octopi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

root@octopi:~# lsmod
Module                  Size  Used by
xt_tcpudp              16384  1
iptable_mangle         16384  1
xt_DSCP                16384  1
bnep                   20480  2
hci_uart               36864  1
btbcm                  16384  1 hci_uart
serdev                 20480  1 hci_uart
bluetooth             368640  24 hci_uart,bnep,btbcm
ecdh_generic           28672  1 bluetooth
fb_ili9340             16384  0
fbtft                  45056  1 fb_ili9340
syscopyarea            16384  1 fbtft
sysfillrect            16384  1 fbtft
sysimgblt              16384  1 fbtft
fb_sys_fops            16384  1 fbtft
stmpe_ts               16384  0
joydev                 20480  0
evdev                  24576  4
brcmfmac              307200  0
brcmutil               16384  1 brcmfmac
cfg80211              573440  1 brcmfmac
rfkill                 28672  6 bluetooth,cfg80211
snd_bcm2835            32768  0
gpio_backlight         16384  0
i2c_bcm2835            16384  0
snd_soc_bcm2835_i2s    16384  0
snd_soc_core          188416  1 snd_soc_bcm2835_i2s
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm                98304  4 snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
spi_bcm2835            16384  0
snd_timer              32768  1 snd_pcm
snd                    69632  5 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
uio_pdrv_genirq        16384  0
fixed                  16384  0
uio                    20480  1 uio_pdrv_genirq
ip_tables              24576  1 iptable_mangle
x_tables               32768  4 iptable_mangle,ip_tables,xt_tcpudp,xt_DSCP
ipv6                  425984  45
root@octopi:~#

root@octopi:/dev/input# ls -la
total 0
drwxr-xr-x  4 root root     220 Jan  3 02:59 .
drwxr-xr-x 15 root root    3420 Jan  3 02:59 ..
drwxr-xr-x  2 root root     120 Jan  3 02:59 by-id
drwxr-xr-x  2 root root     140 Jan  3 02:59 by-path
crw-rw----  1 root input 13, 64 Jan  3 02:59 event0
crw-rw----  1 root input 13, 65 Jan  3 02:59 event1
crw-rw----  1 root input 13, 66 Jan  3 02:59 event2
crw-rw----  1 root input 13, 67 Jan  3 02:59 event3
crw-rw----  1 root input 13, 63 Jan  3 02:59 mice
crw-rw----  1 root input 13, 32 Jan  3 02:59 mouse0
crw-rw----  1 root input 13, 33 Jan  3 02:59 mouse1
root@octopi:/dev/input#
root@octopi:/dev/input# udevadm info -q all /dev/input/event3
P: /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/stmpe-ts/input/input3/event3
N: input/event3
S: input/by-path/platform-3f204000.spi-platform-stmpe-ts-event
E: DEVLINKS=/dev/input/by-path/platform-3f204000.spi-platform-stmpe-ts-event
E: DEVNAME=/dev/input/event3
E: DEVPATH=/devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/stmpe-ts/input/input3/event3
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_PATH=platform-3f204000.spi-platform-stmpe-ts
E: ID_PATH_TAG=platform-3f204000_spi-platform-stmpe-ts
E: MAJOR=13
E: MINOR=67
E: SUBSYSTEM=input
E: USEC_INITIALIZED=5285899

 

on the armbian, no matter what I do I can't get the fb_ili9340 to create /dev/fb1
the module loads ok and displays no errors but no /dev/fb1

 

dmesg shows


 

...


[  139.389950] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[  139.395122] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
root@orangepione:~#


I see fb0 (hdmi monitor) and spidev0.0 devices


 

root@orangepione:~# ls -la /dev/fb* /dev/spi*
crw-rw---- 1 root video  29, 0 Jan  5 23:28 /dev/fb0
crw------- 1 root root  153, 0 Jan  5 23:28 /dev/spidev0.0
root@orangepione:~#

 

 

I modified armbianEnv


 

root@orangepione:/boot# cat armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=e753a023-12c8-405e-b8f7-6b4e3ae873d0
rootfstype=ext4
overlays=spi-spidev spi-add-cs1
param_spidev_spi_bus=0
param_spidev_max_freq=32000000

usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
root@orangepione:/boot#

 

tried without spi-add-cs1 too, without max_freq...

 

it's based on stretch and mainline ... I can try old kernel too if that makes sense..


 

  ___                               ____  _    ___
 / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_)  / _ \ _ __   ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | | | | '_ \ / _ \
| |_| | | | (_| | | | | (_| |  __/ |  __/| | | |_| | | | |  __/
 \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_|  \___/|_| |_|\___|
                       |___/

Welcome to ARMBIAN 5.46 user-built Debian GNU/Linux 9 (stretch) 4.14.48-sunxi
System load:   1.47 1.15 0.51   Up time:       3 min
Memory usage:  15 % of 493MB    IP:            192.168.89.115
CPU temp:      60°C
Usage of /:    30% of 3.4G

root@orangepione:/boot# uname -a
Linux orangepione 4.14.48-sunxi #2 SMP Wed Jun 6 01:50:17 CEST 2018 armv7l GNU/Linux

 

Share this post


Link to post
Share on other sites
15 hours ago, arhi said:

overlays=spi-spidev spi-add-cs1 param_spidev_spi_bus=0 param_spidev_max_freq=32000000

Bringing SPIDEV isn't related to framebuffer. It can only provide you access to the display from userspace program such python script.

To make it attached as framebuffer, you need much more complex DT overlays such the ones found where : https://github.com/notro/fbtft/blob/master/dts

Share this post


Link to post
Share on other sites
15 hours ago, martinayotte said:

Bringing SPIDEV isn't related to framebuffer. It can only provide you access to the display from userspace program such python script.

To make it attached as framebuffer, you need much more complex DT overlays such the ones found where : https://github.com/notro/fbtft/blob/master/dts

 

I'm not smart enough to figure out how to make the DTS from scratch myself... I tried to modify the DTS that works on RPI to work on OPI but had zero success... then I finally got this to work in a way I see the /dev/fb1 on pc2 by adding "overlays=spi-spidev spi-add-cs1" to Env, and by loding fbtft_device with additional parameters..
 

modprobe fbtft_device name=pitft gpios=reset:24,dc:25

 

it all then start to "behave" like it's working, new framebuffer device is created, ili module is loaded etc etc ... but screen don't show no data :( .. at this point I suspect the gpios part is problematic as those gpio24 and gpio25 are rpi numbering, the scheme is different on opi so I tried reset:5,dc:6 but nothing happened :( .. so now I'm searching for other solution

Share this post


Link to post
Share on other sites

also having weird issue with compiling kernel, stmpe_ts module is nowhere to be found in the kernel configuration, I added it manually to .config and loaded it and then it shown but, weird, also the ili_9340 and ili9341 modules, they are built but I don't see them neither in the configuration of the kernel.. something fishy is going on

 

Share this post


Link to post
Share on other sites
8 hours ago, arhi said:

the ili_9340 and ili9341 modules, they are built but I don't see them

https://github.com/armbian/build/blob/master/config/kernel/linux-sunxi-dev.config#L5165-L5166

8 hours ago, arhi said:

stmpe_ts module is nowhere to be found in the kernel configuration

https://github.com/torvalds/linux/blob/master/drivers/input/touchscreen/Kconfig#L1195

https://github.com/armbian/build/blob/master/config/kernel/linux-sunxi-dev.config#L3219

Share this post


Link to post
Share on other sites
On 1/7/2019 at 3:41 PM, martinayotte said:

 

I know, seen all those in the saved config ... "but" when I'm going trough the menu of armbian shown config (I assume the script calls make menuconfig) in the menus I don't see the option to not build ili drivers (they are always on, I have no issues with that but it's just weird) and the config option for the stmpe_ts never shows in the menus ?!?!? now for the stmpe if I add a line in config enabling it and load that config I see the stmpe in the menus then, but not before that, weird...

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0