Jump to content

Orange pi zero fbtft unreliable


jonshouse

Recommended Posts

I am trying to use fbtft on the Orange Pi Zero, seems broken.  Looks like an issue with the SPI driver itself.  My skills are not enough to debug this.

 

I am doing something like this:

    modprobe fbtft_device custom name=fb_ili9340 gpios=dc:3,reset:0 speed=32000000 busnum=1 rotate=90

 

The LCD functions but stops updating after a couple of mins.  Linux is still running but dmesg shows a crash.

 

Login shows "ARMBIAN 5.31 stable Ubuntu 16.04.3 LTS 3.4.113-sun8i"

 

root@orangepizero:~# uname -a
Linux orangepizero 3.4.113-sun8i #18 SMP PREEMPT Thu Jun 15 02:16:06 CEST 2017 armv7l armv7l armv7l GNU/Linux

 

It is not related to SPI speed, i;ve tried as slow as 4Mhz.

 

Anyone any ideas, this seems plain old broken to me rather than any configuration issue ?

 

Thanks,

Jon

 

 

Quote

[  241.030174] kworker/3:1     D c061c3a4     0    27      2 0x00000000
[  241.030262] [<c061c3a4>] (__schedule+0x574/0x7fc) from [<c061c6bc>] (schedule+0x90/0x94)
[  241.030307] [<c061c6bc>] (schedule+0x90/0x94) from [<c061a5fc>] (schedule_timeout+0x2c/0x2bc)
[  241.030352] [<c061a5fc>] (schedule_timeout+0x2c/0x2bc) from [<c061bb98>] (wait_for_common+0x120/0x168)
[  241.030398] [<c061bb98>] (wait_for_common+0x120/0x168) from [<c061bc00>] (wait_for_completion+0x20/0x24)
[  241.030447] [<c061bc00>] (wait_for_completion+0x20/0x24) from [<c03e62c4>] (spi_sync+0x84/0xa0)
[  241.030527] [<c03e62c4>] (spi_sync+0x84/0xa0) from [<bf1ed34c>] (fbtft_write_spi+0xf0/0x104 [fbtft])
[  241.030622] [<bf1ed34c>] (fbtft_write_spi+0xf0/0x104 [fbtft]) from [<bf1ed208>] (fbtft_write_vmem16_bus8+0x11c/0x138 [fbtft])
[  241.030703] [<bf1ed208>] (fbtft_write_vmem16_bus8+0x11c/0x138 [fbtft]) from [<bf1ea918>] (fbtft_update_display+0x150/0x2fc [fbtft])
[  241.030778] [<bf1ea918>] (fbtft_update_display+0x150/0x2fc [fbtft]) from [<bf1ea2a8>] (fbtft_deferred_io+0x110/0x11c [fbtft])
[  241.030844] [<bf1ea2a8>] (fbtft_deferred_io+0x110/0x11c [fbtft]) from [<c038860c>] (fb_deferred_io_work+0x84/0xcc)
[  241.030897] [<c038860c>] (fb_deferred_io_work+0x84/0xcc) from [<c00445a0>] (process_one_work+0x248/0x404)
[  241.030946] [<c00445a0>] (process_one_work+0x248/0x404) from [<c00459d8>] (worker_thread+0x1b4/0x2d0)
[  241.030994] [<c00459d8>] (worker_thread+0x1b4/0x2d0) from [<c0049cf0>] (kthread+0x94/0xa0)
[  241.031044] [<c0049cf0>] (kthread+0x94/0xa0) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[  241.031091] INFO: task kworker/u:3:70 blocked for more than 120 seconds.
[  241.031111] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  241.031132] kworker/u:3     D c061c3a4     0    70      2 0x00000000
[  241.031188] [<c061c3a4>] (__schedule+0x574/0x7fc) from [<c061c6bc>] (schedule+0x90/0x94)
[  241.031230] [<c061c6bc>] (schedule+0x90/0x94) from [<c061a5fc>] (schedule_timeout+0x2c/0x2bc)
[  241.031274] [<c061a5fc>] (schedule_timeout+0x2c/0x2bc) from [<c061bb98>] (wait_for_common+0x120/0x168)
[  241.031319] [<c061bb98>] (wait_for_common+0x120/0x168) from [<c061bc00>] (wait_for_completion+0x20/0x24)
[  241.031367] [<c061bc00>] (wait_for_completion+0x20/0x24) from [<c03e944c>] (sunxi_spi_work+0x748/0x88c)
[  241.031415] [<c03e944c>] (sunxi_spi_work+0x748/0x88c) from [<c00445a0>] (process_one_work+0x248/0x404)
[  241.031459] [<c00445a0>] (process_one_work+0x248/0x404) from [<c00459d8>] (worker_thread+0x1b4/0x2d0)
[  241.031504] [<c00459d8>] (worker_thread+0x1b4/0x2d0) from [<c0049cf0>] (kthread+0x94/0xa0)
[  241.031549] [<c0049cf0>] (kthread+0x94/0xa0) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[  241.031608] INFO: task advmame:1368 blocked for more than 120 seconds.
[  241.031627] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

 

Link to comment
Share on other sites

I tried downgrading the kernel, it is not any better.

 

Does anyone have any ideas what to try before I chuck the board in a box and ignore it for a year ?

 

root@orangepizero:~# uname -a
Linux orangepizero 3.4.112-sun8i #8 SMP PREEMPT Tue May 31 19:00:17 CEST 2016 armv7l armv7l armv7l GNU/Linux

 

Thanks,

Jon

 

Quote

[  184.427362] fbtft_device:  SPI devices registered:
[  184.427436] fbtft_device:      spidev spi0.0 33000kHz 8 bits mode=0x00
[  184.427488] fbtft_device:      spidev spi1.0 33000kHz 8 bits mode=0x00
[  184.427529] fbtft_device:  'fb' Platform devices registered:
[  184.427784] fbtft_device: Deleting spi1.0
[  184.429432] fbtft_device:  GPIOS used by 'fb_ili9340':
[  184.429482] fbtft_device:    'dc' = GPIO3
[  184.429516] fbtft_device:    'reset' = GPIO0
[  184.429547] fbtft_device:  SPI devices registered:
[  184.429591] fbtft_device:      spidev spi0.0 33000kHz 8 bits mode=0x00
[  184.429641] fbtft_device:      fb_ili9340 spi1.0 32000kHz 8 bits mode=0x00
[  184.722560] graphics fb8: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=20, spi1.0 at 32 MHz
[  202.431080] vmouse_input_dev_open
[  202.550069] vmouse_input_dev_close
[  203.100282] vmouse_input_dev_open
[  203.160152] vmouse_input_dev_close
[  203.420820] vmouse_input_dev_open
[  203.470164] vmouse_input_dev_close
[  204.010266] vmouse_input_dev_open
[  205.217082] warning: process `advmame' used the deprecated sysctl system call with 8.1.2.
[  480.920361] INFO: task kworker/u:0:5 blocked for more than 120 seconds.
[  480.920412] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  480.920460] kworker/u:0     D c069dc8c     0     5      2 0x00000000
[  480.920617] [<c069dc8c>] (__schedule+0x574/0x7fc) from [<c069dfa4>] (schedule+0x90/0x94)
[  480.920707] [<c069dfa4>] (schedule+0x90/0x94) from [<c069bee4>] (schedule_timeout+0x2c/0x2bc)
[  480.920796] [<c069bee4>] (schedule_timeout+0x2c/0x2bc) from [<c069d480>] (wait_for_common+0x120/0x168)
[  480.920887] [<c069d480>] (wait_for_common+0x120/0x168) from [<c069d4e8>] (wait_for_completion+0x20/0x24)
[  480.920989] [<c069d4e8>] (wait_for_completion+0x20/0x24) from [<c045e828>] (sunxi_spi_work+0x748/0x888)
[  480.921093] [<c045e828>] (sunxi_spi_work+0x748/0x888) from [<c0044508>] (process_one_work+0x248/0x404)
[  480.921189] [<c0044508>] (process_one_work+0x248/0x404) from [<c0045940>] (worker_thread+0x1b4/0x2d0)
[  480.921282] [<c0045940>] (worker_thread+0x1b4/0x2d0) from [<c0049c58>] (kthread+0x94/0xa0)
[  480.921380] [<c0049c58>] (kthread+0x94/0xa0) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[  480.921456] INFO: task kworker/2:1:25 blocked for more than 120 seconds.

 

Link to comment
Share on other sites

Well, this kernel is how it is. There will be not much fiddling around but you have support for those displays also in the modern kernel. That is your best chance. Unfortunately, this kernel is also not quite ready so other problems might pop out.

 

https://dl.armbian.com/orangepizero/nightly/ (apt upgrade might break your system at this moment so don't)

https://docs.armbian.com/User-Guide_Allwinner_overlays/ (you need to enable SPI, so read this)

 

I am not sure if this is all working as it should but its worth trying.

Link to comment
Share on other sites

I had a problem like this too and never found a solution using legacy.  However, moving over to mainline worked for me.  My displays have been running for months without crashes. There are caveats however - it didn't work out of the box,  But,  there are some good threads in this forum where a few people helped me and others get up and running.  Search "pygame lcd" and you'll find the threads.  It took some time and several tries I almost gave up, but I finally got it working. 

 

Try it, and post your progress in the forum.  I'll come back in a few days and see if there is anything I can contribute.  You might get lucky and the smart people who helped me might chime in first.

 

I wish you luck!  Stay with it, it'll be worth it and you'll be able to keep armbian. 

Link to comment
Share on other sites

On 2017/9/2 at 8:52 PM, jonshouse said:

I am doing something like this:

    modprobe fbtft_device custom name=fb_ili9340 gpios=dc:3,reset:0 speed=32000000 busnum=1 rotate=90

 

 

I tried same command, and it's work fine.

 

orangepi@orangepizero:~$ sudo modprobe fbtft_device custom name=fb_ili9340 gpios=dc:3,reset:0 speed=32000000 busnum=1 rotate=90
orangepi@orangepizero:~$ con2fbmap 1 8
orangepi@orangepizero:~$ uname -a
Linux orangepizero 3.4.113-sun8i #18 SMP PREEMPT Thu Jun 15 02:16:06 CEST 2017 armv7l GNU/Linux

 

LED-----ZERO

----------------

CS-------Pin#24

RESET---Pin#13

D/C-------Pin#15

SDI-------Pin#19

SCK-------Pn#23

 

 

 

Link to comment
Share on other sites

@nopnop2002 - does your configuration work for more than 20 minutes when running some sort of graphic program?  My original setup would work well too, but then after awhile (8-20 minutes) it would crash.   In my case I was running a pygame program.

Link to comment
Share on other sites

@nopnop2002 I have an ILI9341 SPI on OPI-Zero running for days.

[    8.684094] fbtft_device:  SPI devices registered:
[    8.689553] fbtft_device:      spidev spi0.0 33000kHz 8 bits mode=0x00
[    8.697015] fbtft_device:      spidev spi1.0 32000kHz 8 bits mode=0x00
[    8.704430] fbtft_device:  'fb' Platform devices registered:
[    8.711067] fbtft_device: Deleting spi1.0
[    8.716397] fbtft_device:  GPIOS used by 'tm022hdh26':
[    8.722277] fbtft_device:    'reset' = GPIO7
[    8.727109] fbtft_device:    'dc' = GPIO2
[    8.731749] fbtft_device:    'led' = GPIO6
[    8.736378] fbtft_device:  SPI devices registered:
[    8.741841] fbtft_device:      spidev spi0.0 33000kHz 8 bits mode=0x00
[    8.749229] fbtft_device:      fb_ili9341 spi1.0 32000kHz 8 bits mode=0x00

Although I don't have a DE there. It is just a small Qt application with a single label. I only change the content of the label from time to time so there is no much traffic on the SPI bus.

Link to comment
Share on other sites

Sorry for the delay.

I've upgraded via apt-get upgrade, apt-get update. Am now running this kernel.

 

Quote

root@orangepizero:~# uname -a
Linux orangepizero 3.4.113-sun8i #12 SMP PREEMPT Fri Sep 15 00:26:14 CEST 2017 armv7l armv7l armv7l GNU/Linux

 

I have the following shell script, I called it /lcd1

Quote

#!/bin/bash
modprobe fbtft_device custom name=fb_ili9340 gpios=dc:3,reset:0 speed=32000000 busnum=1 rotate=90 bgr=1
sleep 2
con2fbmap 1 8

 

I login via ethernet/ssh as root and run the script, LCD comes up ok.

 

After running anything that does regular framebuffer updates it still locks the display after a few mins, linux continues to run.

 

mame seems to kill it quickly, dmesg has the following

 

Quote

[  113.076235] warning: process `advmame' used the deprecated sysctl system call with 8.1.2.
[  361.030206] INFO: task kworker/u:0:5 blocked for more than 120 seconds.
[  361.030258] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  361.030303] kworker/u:0     D c061c3a4     0     5      2 0x00000000
[  361.030452] [<c061c3a4>] (__schedule+0x574/0x7fc) from [<c061c6bc>] (schedule+0x90/0x94)
[  361.030540] [<c061c6bc>] (schedule+0x90/0x94) from [<c061a5fc>] (schedule_timeout+0x2c/0x2bc)
[  361.030629] [<c061a5fc>] (schedule_timeout+0x2c/0x2bc) from [<c061bb98>] (wait_for_common+0x120/0x168)
[  361.030719] [<c061bb98>] (wait_for_common+0x120/0x168) from [<c061bc00>] (wait_for_completion+0x20/0x24)
[  361.030817] [<c061bc00>] (wait_for_completion+0x20/0x24) from [<c03e944c>] (sunxi_spi_work+0x748/0x88c)
[  361.030918] [<c03e944c>] (sunxi_spi_work+0x748/0x88c) from [<c00445a0>] (process_one_work+0x248/0x404)
[  361.031011] [<c00445a0>] (process_one_work+0x248/0x404) from [<c00459d8>] (worker_thread+0x1b4/0x2d0)
[  361.031105] [<c00459d8>] (worker_thread+0x1b4/0x2d0) from [<c0049cf0>] (kthread+0x94/0xa0)
[  361.031201] [<c0049cf0>] (kthread+0x94/0xa0) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[  361.031273] INFO: task kworker/1:1:25 blocked for more than 120 seconds.
[  361.031313] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  361.031355] kworker/1:1     D c061c3a4     0    25      2 0x00000000
[  361.031466] [<c061c3a4>] (__schedule+0x574/0x7fc) from [<c061c6bc>] (schedule+0x90/0x94)
[  361.031551] [<c061c6bc>] (schedule+0x90/0x94) from [<c061a5fc>] (schedule_timeout+0x2c/0x2bc)
[  361.031637] [<c061a5fc>] (schedule_timeout+0x2c/0x2bc) from [<c061bb98>] (wait_for_common+0x120/0x168)
[  361.031726] [<c061bb98>] (wait_for_common+0x120/0x168) from [<c061bc00>] (wait_for_completion+0x20/0x24)
[  361.031816] [<c061bc00>] (wait_for_completion+0x20/0x24) from [<c03e62c4>] (spi_sync+0x84/0xa0)
[  361.031958] [<c03e62c4>] (spi_sync+0x84/0xa0) from [<bf1ed34c>] (fbtft_write_spi+0xf0/0x104 [fbtft])
[  361.032136] [<bf1ed34c>] (fbtft_write_spi+0xf0/0x104 [fbtft]) from [<bf1ed208>] (fbtft_write_vmem16_bus8+0x11c/0x138 [fbtft])
[  361.032295] [<bf1ed208>] (fbtft_write_vmem16_bus8+0x11c/0x138 [fbtft]) from [<bf1ea918>] (fbtft_update_display+0x150/0x2fc [fbtft])
[  361.032445] [<bf1ea918>] (fbtft_update_display+0x150/0x2fc [fbtft]) from [<bf1ea2a8>] (fbtft_deferred_io+0x110/0x11c [fbtft])
[  361.032573] [<bf1ea2a8>] (fbtft_deferred_io+0x110/0x11c [fbtft]) from [<c038860c>] (fb_deferred_io_work+0x84/0xcc)
[  361.032670] [<c038860c>] (fb_deferred_io_work+0x84/0xcc) from [<c00445a0>] (process_one_work+0x248/0x404)
[  361.032760] [<c00445a0>] (process_one_work+0x248/0x404) from [<c00459d8>] (worker_thread+0x1b4/0x2d0)
[  361.032850] [<c00459d8>] (worker_thread+0x1b4/0x2d0) from [<c0049cf0>] (kthread+0x94/0xa0)
[  361.032940] [<c0049cf0>] (kthread+0x94/0xa0) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8)
[  361.033053] INFO: task advmame:1561 blocked for more than 120 seconds.
[  361.033093] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  361.033135] advmame         D c061c3a4     0  1561   1517 0x00000000
[  361.033246] [<c061c3a4>] (__schedule+0x574/0x7fc) from [<c061c6bc>] (schedule+0x90/0x94)
[  361.033333] [<c061c6bc>] (schedule+0x90/0x94) from [<c061caac>] (schedule_preempt_disabled+0x30/0x40)
[  361.033425] [<c061caac>] (schedule_preempt_disabled+0x30/0x40) from [<c061b290>] (__mutex_lock_slowpath+0x160/0x1a8)
[  361.033518] [<c061b290>] (__mutex_lock_slowpath+0x160/0x1a8) from [<c061b33c>] (mutex_lock+0x64/0x7c)
[  361.033607] [<c061b33c>] (mutex_lock+0x64/0x7c) from [<c03884f8>] (fb_deferred_io_mkwrite+0x2c/0xbc)
[  361.033699] [<c03884f8>] (fb_deferred_io_mkwrite+0x2c/0xbc) from [<c00ff630>] (do_wp_page+0x224/0x7a4)
[  361.033789] [<c00ff630>] (do_wp_page+0x224/0x7a4) from [<c0101210>] (handle_pte_fault+0x7b0/0x838)
[  361.033874] [<c0101210>] (handle_pte_fault+0x7b0/0x838) from [<c0101390>] (handle_mm_fault+0xf8/0x134)
[  361.033961] [<c0101390>] (handle_mm_fault+0xf8/0x134) from [<c001b180>] (do_page_fault+0x11c/0x344)
[  361.034047] [<c001b180>] (do_page_fault+0x11c/0x344) from [<c00083a8>] (do_DataAbort+0x44/0xa8)
[  361.034132] [<c00083a8>] (do_DataAbort+0x44/0xa8) from [<c000dcd8>] (__dabt_usr+0x38/0x40)
[  361.034184] Exception stack(0xd719ffb0 to 0xd719fff8)
[  361.034237] ffa0:                                     00000000 00000000 b5aa3000 0445f912
[  361.034307] ffc0: 00000000 00000000 b5aa3000 00000000 00000001 0000000b 0000f800 0000001f
[  361.034374] ffe0: 00000120 bef33fc8 fffffe00 0003d094 68000030 ffffffff

 

Note "[  361.030817] [<c061bc00>] (wait_for_completion+0x20/0x24) from [<c03e944c>] (sunxi_spi_work+0x748/0x88c)"  Is that a stall waiting for something in the SPI driver to unlock ?

 

Anyhew, bottom line is it still does not work in any useful manner.

 

 

Link to comment
Share on other sites

Hi there, currently having the same issue with an 3.5 inch LCD. (ili9486) on a OPI One (kernel 3.4.113)

This command brings up the display: modprobe fbtft_device rotate=90 name=piscreen speed=16000000 gpios=reset:2,dc:71 txbuflen=32768 fps=25

But the screen hangs after some seconds of usage with the same "120 sec kworker timout" as above.

Since this happens on multiple boards with legacy kernel, there must be someone who solved this!?

Link to comment
Share on other sites

I have a small SPI LCD that I recently attached and configured on an RPi Zero, and when I saw this post my curiosity got the better of me and I attached it to my OPi PC+ using the fbtft drivers.

 

OS: Ubuntu 16.04 xenial

Linux orangepipcplus 3.4.113-sun8i #4 SMP PREEMPT Wed Nov 22 13:45:28 CET 2017 armv7l armv7l armv7l GNU/Linux


Sadly, i can report the same issue on my system.  It worked faultlessly for about 30 minutes, then crashed in the exact same manner:

[ 1800.550427] INFO: task kworker/0:2:71 blocked for more than 120 seconds.
[ 1800.550436] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1800.550447] kworker/0:2     D c061d264     0    71      2 0x00000000
[ 1800.550474] [<c061d264>] (__schedule+0x574/0x7fc) from [<c061d57c>] (schedule+0x90/0x94)
[ 1800.550495] [<c061d57c>] (schedule+0x90/0x94) from [<c061b4bc>] (schedule_timeout+0x2c/0x2bc)
[ 1800.550517] [<c061b4bc>] (schedule_timeout+0x2c/0x2bc) from [<c061ca58>] (wait_for_common+0x120/0x168)
[ 1800.550539] [<c061ca58>] (wait_for_common+0x120/0x168) from [<c061cac0>] (wait_for_completion+0x20/0x24)
[ 1800.550561] [<c061cac0>] (wait_for_completion+0x20/0x24) from [<c03e6384>] (spi_sync+0x84/0xa0)
[ 1800.550601] [<c03e6384>] (spi_sync+0x84/0xa0) from [<bf2be34c>] (fbtft_write_spi+0xf0/0x104 [fbtft])
[ 1800.550643] [<bf2be34c>] (fbtft_write_spi+0xf0/0x104 [fbtft]) from [<bf2be208>] (fbtft_write_vmem16_bus8+0x11c/0x138 [fbtft])
[ 1800.550682] [<bf2be208>] (fbtft_write_vmem16_bus8+0x11c/0x138 [fbtft]) from [<bf2bb918>] (fbtft_update_display+0x150/0x2fc [fbtft])
[ 1800.550720] [<bf2bb918>] (fbtft_update_display+0x150/0x2fc [fbtft]) from [<bf2bb2a8>] (fbtft_deferred_io+0x110/0x11c [fbtft])
[ 1800.550752] [<bf2bb2a8>] (fbtft_deferred_io+0x110/0x11c [fbtft]) from [<c03886cc>] (fb_deferred_io_work+0x84/0xcc)
[ 1800.550777] [<c03886cc>] (fb_deferred_io_work+0x84/0xcc) from [<c0044660>] (process_one_work+0x248/0x404)
[ 1800.550799] [<c0044660>] (process_one_work+0x248/0x404) from [<c0045a98>] (worker_thread+0x1b4/0x2d0)
[ 1800.550820] [<c0045a98>] (worker_thread+0x1b4/0x2d0) from [<c0049db0>] (kthread+0x94/0xa0)
[ 1800.550843] [<c0049db0>] (kthread+0x94/0xa0) from [<c000f270>] (kernel_thread_exit+0x0/0x8)

 

 

 

Link to comment
Share on other sites

On 1/21/2018 at 10:31 PM, King Beetle said:

Sadly, i can report the same issue on my system.  It worked faultlessly for about 30 minutes, then crashed in the exact same manner:

Thank you trying it out

 

By now i can confirm that it works on mainline kernel, but the whole point is to use mali accleration of the old kernel.

So we have to hope either on mainline gpu accleration or a spi fix for the legacy kernel. Meanwhile i resorted to using an HDMI based 3.5 inch display, which is obviously more expensive and power hungry, but does the job for now.

 

Link to comment
Share on other sites

I'm testing SPI_LCD and BB-CP from this github: https://github.com/bitbank2 on my nanopi m1 and the LCD (A 320x240 LCD with ILI9341 as its driver) keep running normal for 5 hours until now. I think this is the best workaround for SPI issue on legacy kernel

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines