notro / fbtft

Linux Framebuffer drivers for small TFT LCD display modules. Development has moved to https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing
1.85k stars 496 forks source link

adafruit22a issues #480

Closed taxilly closed 6 years ago

taxilly commented 6 years ago

On Linux pilove 4.9.50+ #1035 Wed Sep 13 22:53:09 BST 2017 armv6l GNU/Linux Running sudo modprobe fbtft_device name=adafruit22a rotate=270 debug=32

Causes the display to turn black momentarily and then white again - the display seems to work erratically, sometime working fine, and others nothing at all...

I've also noticed the display, when working, sometimes turns white. I can control backlight brightness, I've also added fbcon=map:10 to /boot/cmdline.txt.

dmesg:

[   25.490113] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[   25.495675] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[   25.496872] spidev spi0.0: spidev spi0.0 125000kHz 8 bits mode=0x00
[   25.496888] spidev spi0.1: spidev spi0.1 125000kHz 8 bits mode=0x00
[   25.496929] bcm2708_fb soc:fb: soc:fb id=-1 pdata? no
[   25.496961] spidev spi0.0: Deleting spi0.0
[   25.497679] fbtft_device: GPIOS used by 'adafruit22a':
[   25.497688] fbtft_device: 'reset' = GPIO25
[   25.497692] fbtft_device: 'dc' = GPIO24
[   25.497697] fbtft_device: 'led' = GPIO18
[   25.497709] spidev spi0.1: spidev spi0.1 125000kHz 8 bits mode=0x00
[   25.497718] spi spi0.0: fb_ili9340 spi0.0 32000kHz 8 bits mode=0x00
[   25.538302] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[   25.540766] fb_ili9340 spi0.0: fbtft_request_gpios: 'reset' = GPIO25
[   25.540790] fb_ili9340 spi0.0: fbtft_request_gpios: 'dc' = GPIO24
[   25.540808] fb_ili9340 spi0.0: fbtft_request_gpios: 'led' = GPIO18
[   25.878928] fb_ili9340 spi0.0: Display update: 3422 kB/s, fps=0
[   25.913752] graphics fb1: fb_ili9340 frame buffer, 240x320, 150 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 32 MHz
[   25.987168] fb_ili9340 spi0.0: Display update: 2688 kB/s, fps=10
[   26.143028] fb_ili9340 spi0.0: Display update: 3156 kB/s, fps=4
[   26.354075] fb_ili9340 spi0.0: Display update: 2423 kB/s, fps=4
[   26.563021] fb_ili9340 spi0.0: Display update: 3180 kB/s, fps=4
[   26.772999] fb_ili9340 spi0.0: Display update: 3222 kB/s, fps=4
[   26.984694] fb_ili9340 spi0.0: Display update: 1652 kB/s, fps=4

lsmod:

Module                  Size  Used by
fb_ili9340              3722  2 
fbtft_device           37141  0 
fbtft                  32647  2 fbtft_device,fb_ili9340
syscopyarea             3161  1 fbtft
sysfillrect             3716  1 fbtft
sysimgblt               2422  1 fbtft
fb_sys_fops             1677  1 fbtft
spidev                  7034  0 
brcmfmac              267114  0 
brcmutil                9911  1 brcmfmac
spi_bcm2835             7424  0 
bcm2835_gpiomem         3791  0 
uio_pdrv_genirq         3718  0 
fixed                   3029  0 
uio                    10166  1 uio_pdrv_genirq
snd_bcm2835            23131  0 
snd_pcm                97825  1 snd_bcm2835
snd_timer              22706  1 snd_pcm
snd                    68784  3 snd_timer,snd_bcm2835,snd_pcm
mac80211              650707  0 
cfg80211              525998  2 mac80211,brcmfmac
rfkill                 21373  2 cfg80211
ipv6                  384391  26 

Tried changing speed to 10MHz, setting lower FPS etc etc.

I saw this issue: https://github.com/adafruit/Adafruit_Python_ILI9341/issues/1

when I run the examples the screen turns black for a second and then goes back to white.

Which expresses the same issue I'm having.

Any advice is greatly appreciated...

notro commented 6 years ago

The first thing to try with problems like this is to lower the speed, which you have tried. The next is checking wiring. The ultimate test is to look at the signals with a scope or logic analyzer.

taxilly commented 6 years ago

Looked at the signals and noticed MOSI looked a bit weak, checked the pin soldering and saw it was pretty poor, re-soldered and it works reliably now. Also explains why sometimes it'd work, I guess the pins just touched the contacts more... My bad.