XU4+3.5"LCD Shield

Moderators: odroid, mdrjr

XU4+3.5"LCD Shield

Unread postby Dasypus » Wed Jan 24, 2018 12:14 am

Hi all,
I have used install script from https://forum.odroid.com/viewtopic.php?f=145&t=24248.
I get errors on boot (in dmesg and similar on LCD):

[ 6.750792] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 6.762285] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 6.771364] fbtft_device: GPIOS used by 'flexpfb':
[ 6.775498] fbtft_device: 'reset' = GPIO174
[ 6.779653] fbtft_device: 'dc' = GPIO28
[ 6.783462] fbtft_device: 'wr' = GPIO190
[ 6.787363] fbtft_device: 'cs' = GPIO173
[ 6.791281] fbtft_device: 'db00' = GPIO23
[ 6.795257] fbtft_device: 'db01' = GPIO24
[ 6.799249] fbtft_device: 'db02' = GPIO19
[ 6.803230] fbtft_device: 'db03' = GPIO189
[ 6.807302] fbtft_device: 'db04' = GPIO191
[ 6.807305] fbtft_device: 'db05' = GPIO192
[ 6.807310] fbtft_device: 'db06' = GPIO22
[ 6.807313] fbtft_device: 'db07' = GPIO21
[ 6.807317] fbtft_device: 'led' = GPIO31
[ 6.807979] platform flexpfb.0: flexpfb id=0 pdata? yes
[ 6.812197] flexfb: module is from the staging directory, the quality is unknown, you have been warned.
[ 6.814830] flexfb_probe_common : ioremap gpiox register success!
[ 7.509373] systemd-journald[243]: Received request to flush runtime journal from PID 1
[ 7.944721] Console: switching to colour frame buffer device 60x20
[ 7.950442] graphics fb0: flexfb frame buffer, 480x320, 300 KiB video memory, 4 KiB buffer memory, fps=20
[ 7.962982] sx865x 5-0049: sx865x_probe()
[ 7.968348] sx865x 5-0049: swap_xy (1)
[ 7.972384] sx865x 5-0049: invert_x (0)
[ 7.976109] sx865x 5-0049: invert_y (1)
[ 7.979914] sx865x 5-0049: gpio pendown (33)
[ 7.984162] sx865x 5-0049: gpio reset (29)
[ 7.988223] sx865x 5-0049: gpio irq (153)
[ 7.993031] input: SX865X Touchscreen as /devices/platform/soc/12cb0000.i2c/i2c-5/5-0049/input/input1
[ 8.003997] sx865x 5-0049: probe ok! registered with irq (153)
[ 8.333370] gpiomem-exynos 13400000.gpiomem: Initialised: GPIO register area is 2
[ 8.333694] gpiomem-exynos 13400000.gpiomem: Initialised: Registers at 0x13400000
[ 8.333705] gpiomem-exynos 13400000.gpiomem: Initialised: Registers at 0x14010000
[ 8.536003] spi spi1.0: Failed to get /CS gpio [190]: -16
[ 8.540753] s3c64xx-spi 12d30000.spi: can't setup spi1.0, status -16
[ 8.547823] spi_master spi1: spi_device register error /soc/spi@12d30000/spidev@0
[ 8.555367] spi_master spi1: Failed to create SPI device for /soc/spi@12d30000/spidev@0


my image is:
Linux odroid 4.14.13-100 #1 SMP PREEMPT Fri Jan 12 19:09:58 UTC 2018 armv7l armv7l armv7l GNU/Linux

So seems to be partially working, maybe a connection problem (gpio190)?

Many Thanks,
Das
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Wed Jan 24, 2018 3:04 am

So many noob questions...
Is the "Failed to get /CS gpio" normal, expected?
I don't see how SPI comes into this, as the interface is 8bit parallel?
I do however seem to have an X server running, lightdm, but not on the 3.5" LCD.
There is just text on the LCD, boot stuff, and text slightly corrupted, with some blue background, where the errors are, possibly.
Plugging in HDMI I see nothing, but after rebooting I do, I see MATE desktop!!
How do I now see an X display (Mate display manager) when there is no xorg.conf for it on the HDMI?

xorg.conf is:

Section "Device"
Identifier "Mali-Fbdev"
Driver "armsoc"
Option "fbdev" "/dev/fb0"
Option "Debug" "false"
Option "DPMS" "false"
Option "NoFlip" "true"
Option "NoHardwareMouse" "true"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection

Section "DRI"
Mode 0666
EndSection



I'm not sure about Mali-dev and armsoc section stuff, but I assume that armsoc takes the fbdev as argument to set up/start driver?

I also have no mouse/keyboard attached, don't have.

Basically: I have text on LCD, no Mate DM...

Ideas, help please, Thx...

Das
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby odroid » Wed Jan 24, 2018 9:06 am

Can you show me "lsmod" output?
If you can find any "*spi*" stuff, add them in /etc/modprobe.d/blacklist-odroid.conf and reboot.
Code: Select all
blacklist spi_s3c64xx
blacklist spidev
User avatar
odroid
Site Admin
 
Posts: 27660
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Thu Jan 25, 2018 1:22 am

Thanx Odroid,
Code: Select all
root@odroid:~# lsmod
Module                  Size  Used by
fuse                   86016  3
cpufreq_conservative    16384  0
cpufreq_userspace      16384  0
cpufreq_powersave      16384  0
arc4                   16384  2
rtl8192cu              86016  0
rtl_usb                20480  1 rtl8192cu
rtl8192c_common        49152  1 rtl8192cu
rtlwifi                73728  3 rtl_usb,rtl8192c_common,rtl8192cu
mac80211              516096  3 rtl_usb,rtlwifi,rtl8192cu
cfg80211              479232  2 mac80211,rtlwifi
rfkill                 20480  3 cfg80211
spi_s3c64xx            20480  0
exynos_gpiomem         16384  0
joydev                 20480  0
sx865x                 16384  0
flexfb                 16384  2
fbtft_device           40960  0
fbtft                  36864  2 fbtft_device,flexfb
ipv6                  380928  40
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Thu Jan 25, 2018 2:21 am

So how do I get X running on this LCD?

X is running:
root@odroid:~# ps -ef | grep X
root 859 847 3 17:10 tty7 00:00:00 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdh
root 1475 1346 0 17:10 ttySAC2 00:00:00 grep --color=auto X

but there is just text on LCD

root@odroid:~# ls /dev/fb0
/dev/fb0

root@odroid:~# cat /etc/X11/xorg.conf.d/99-odroid-lcd35.conf
Section "Device"
Identifier "C fbdev"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection

Thank you,
Das
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby odroid » Thu Jan 25, 2018 9:15 am

If you can see text consoles on the LCD, refer this link.
https://wiki.odroid.com/accessory/displ ... lcd_shield
User avatar
odroid
Site Admin
 
Posts: 27660
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: XU4+3.5"LCD Shield

Unread postby phaseshifter » Sat Jan 27, 2018 4:06 pm

i wrote this a long time ago but may help you

viewtopic.php?f=145&t=24365
odroid N-1 16Gb emmc orange..
phaseshifter
 
Posts: 2760
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Sat Feb 03, 2018 9:26 pm

Should the shifter shield be set to 5v or 3.3v
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby mad_ady » Sat Feb 03, 2018 9:41 pm

3.3V
User avatar
mad_ady
 
Posts: 3621
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Sat Feb 03, 2018 10:03 pm

Thanks. Also, when I start modules I get:
root@odroid:~# modprobe fbtft_device name=flexpfb rotate=270
root@odroid:~# modprobe flexfb chip=ili9488
[ 113.597581] flexfb_probe_common : ioremap gpiox register success!
[ 113.602297] flexfb flexpfb.0: fbtft_request_gpios: gpio_request_one('wr'=190) failed with -16
[ 166.051725] flexfb_probe_common : ioremap gpiox register success!
[ 166.056451] flexfb flexpfb.0: fbtft_request_gpios: gpio_request_one('wr'=190) failed with -16

Is this normal or error?
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby mad_ady » Sat Feb 03, 2018 11:51 pm

Looks like an error. Some module is claiming that gpio before that driver can. Here is dmesg output on a c2:
Code: Select all
adrianp@uy-scuti:~$ dmesg | grep fbtft                      [   12.765897] fbtft_device:  SPI devices registered:
[   12.765902] fbtft_device:  'fb' Platform devices registered:
[   12.765928] fbtft_device:      meson-fb id=-1 pdata? no  [   12.766095] fbtft_device:  GPIOS used by 'flexpfb':      [   12.766097] fbtft_device:    'reset' = GPIO247           [   12.766098] fbtft_device:    'dc' = GPIO228
[   12.766099] fbtft_device:    'wr' = GPIO229              [   12.766100] fbtft_device:    'cs' = GPIO238              [   12.766101] fbtft_device:    'db00' = GPIO233
[   12.766103] fbtft_device:    'db01' = GPIO231            [   12.766104] fbtft_device:    'db02' = GPIO236
[   12.766105] fbtft_device:    'db03' = GPIO230            [   12.766106] fbtft_device:    'db04' = GPIO232
[   12.766107] fbtft_device:    'db05' = GPIO235
[   12.766108] fbtft_device:    'db06' = GPIO237
[   12.766109] fbtft_device:    'db07' = GPIO239            [   12.766110] fbtft_device:  'fb' Platform devices registered:                                                         [   12.766122] fbtft_device:      meson-fb id=-1 pdata? no
[   12.766139] fbtft_device:      flexpfb id=0 pdata? yes   [   18.090111]  fbtft_device                                [   18.090112]  fbtft                                       adrianp@uy-scuti:~$               
adrianp@uy-scuti:~$ dmesg | grep flexfb                     [   13.161156] graphics fb2: flexfb frame buffer, 480x320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20
[   18.090110]  flexfb                                                               
User avatar
mad_ady
 
Posts: 3621
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: XU4+3.5"LCD Shield

Unread postby odroid » Sun Feb 04, 2018 10:29 am

You still have the SPI driver module which conflicts with the fbtft driver.
Code: Select all
spi_s3c64xx            20480  0

Please check the blacklist file and "lsmod" output again.
User avatar
odroid
Site Admin
 
Posts: 27660
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Sun Feb 11, 2018 12:34 am

Thanks all, I now have X display :-). Yes, spi driver.
So, lightdm running, but no touchscreen. From instruction if I do:
root@odroid:~# DISPLAY=:0 xinput set-prop 'SX865X Touchscreen' 'Evdev Axes Swap' 0
No protocol specified
Unable to connect to X server
root@odroid:~# ps -ef | grep X
root 841 831 0 14:34 tty7 00:00:01 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
I think maybe authentication, so if I do:
root@odroid:~# systemctl stop lightdm.service
root@odroid:~# X :0 vt7 -ac
I get X running and can now connect:
root@odroid:~# DISPLAY=:0 xeyes
But:
root@odroid:~# xinput_calibrator
Error: No calibratable devices found.
root@odroid:~# xinput set-prop 'SX865X Touchscreen' 'Evdev Axes Swap' 0
unable to find device SX865X Touchscreen
Also I notice:
root@odroid:~# systemctl status odroid-lcd35.service
‚óŹ odroid-lcd35.service - Odroid LCD 3.5
Loaded: loaded (/etc/systemd/system/odroid-lcd35.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2016-02-11 16:34:06 UTC; 1 years 11 months ago
Main PID: 712 (code=exited, status=203/EXEC)

Feb 11 16:34:05 odroid systemd[1]: Starting Odroid LCD 3.5...
Feb 11 16:34:06 odroid systemd[1]: odroid-lcd35.service: Main process exited, code=exited, status=203/EXEC
Feb 11 16:34:06 odroid systemd[1]: Failed to start Odroid LCD 3.5.
Feb 11 16:34:06 odroid systemd[1]: odroid-lcd35.service: Unit entered failed state.
Feb 11 16:34:06 odroid systemd[1]: odroid-lcd35.service: Failed with result 'exit-code'.
Feb 10 14:46:02 odroid systemd[1]: [/etc/systemd/system/odroid-lcd35.service:4] Unknown section 'Path'. Ignoring.
Feb 10 14:49:49 odroid systemd[1]: [/etc/systemd/system/odroid-lcd35.service:4] Unknown section 'Path'. Ignoring.
Feb 10 14:50:42 odroid systemd[1]: [/etc/systemd/system/odroid-lcd35.service:4] Unknown section 'Path'. Ignoring.
Feb 10 14:53:12 odroid systemd[1]: [/etc/systemd/system/odroid-lcd35.service:4] Unknown section 'Path'. Ignoring.
So, I can run xeyes on the display, but no eye movement with stylus, and it seems very slow to render.
Any clues appreciated, but I expect I should really clue up on what all the modules & config should be doing.
Thanks again,
Das
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Sun Feb 11, 2018 12:48 am

Sorted odroid-lcd35.service, ExecStart=/bin/con2fbmap 1 0, not 1 2. FB is :0.
Still no touchpad however, and very slow render.

Code: Select all
root@odroid:~# lsmod
Module                  Size  Used by
fuse                   86016  1
cpufreq_conservative    16384  0
cpufreq_userspace      16384  0
cpufreq_powersave      16384  0
extcon_usb_gpio        16384  0
exynos_gpiomem         16384  0
sx865x                 16384  0
flexfb                 16384  2
fbtft_device           40960  0
fbtft                  36864  2 fbtft_device,flexfb
ipv6                  380928  68
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english

Re: XU4+3.5"LCD Shield

Unread postby mad_ady » Sun Feb 11, 2018 2:17 am

The touchscreen should register as an input device:
Code: Select all

adrianp@uy-scuti:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*Available devices:
/dev/input/event0:      cec_input
/dev/input/event1:      vt-input
/dev/input/event2:      C-Media USB Headphone Set
/dev/input/event3:      SX865X Touchscreen
/dev/input/event4:      USB 2.0 Camera
/dev/input/event5:      meson-ir
/dev/input/event6:      MCE IR Keyboard/Mouse (meson-ir)
Select the device event number [0-6]: ^C
130 adrianp@uy-scuti:~$
User avatar
mad_ady
 
Posts: 3621
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: XU4+3.5"LCD Shield

Unread postby odroid » Sun Feb 11, 2018 10:10 am

The framerate is limited at around ~10FPS due to slow GPIO toggling speed.
To enable the touchscreen, you have to modify the dtb file (exynos5422-odroidxu4.dtb) to use sx865x driver correctly.
https://wiki.odroid.com/accessory/displ ... rt_modules

Which kernel version do you use?
The latest kernel should be
Code: Select all
odroid@odroid:~$ uname -a
Linux odroid 4.14.18-105 #1 SMP PREEMPT Fri Feb 9 15:12:30 UTC 2018 armv7l armv7l armv7l GNU/Linux
User avatar
odroid
Site Admin
 
Posts: 27660
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: XU4+3.5"LCD Shield

Unread postby mad_ady » Sun Feb 11, 2018 3:14 pm

offtopic @odroid: what's the gpio toggling speed for n1 with regard to the 3.5" screen? Could it work at a higher framerate?
User avatar
mad_ady
 
Posts: 3621
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: XU4+3.5"LCD Shield

Unread postby Dasypus » Sun Feb 11, 2018 10:58 pm

My bad, thought I had done the dtd file, I've re-flashed so many times now must've missed it this time.
So, thanks all, touchscreen working too:
Code: Select all
root@odroid:~# uname -a
Linux odroid 4.14.16-104 #1 SMP PREEMPT Thu Feb 1 03:11:05 UTC 2018 armv7l armv7l armv7l GNU/Linux
root@odroid:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:   gpio_keys
/dev/input/event1:   SX865X Touchscreen

It is very slow though, 10fps, I was hoping to do real-time graphs on it just using X and no desktop/display manager.
Thx again,
Das
Dasypus
 
Posts: 20
Joined: Fri Aug 25, 2017 2:20 am
languages_spoken: english


Return to 3.5inch LCD Shield

Who is online

Users browsing this forum: No registered users and 2 guests