I'm trying to configure waveshare 35b touchscreen on raspberry 3. I have 2 problems :
- slow refresh rate
- inverted colors (black is white)
Here is my config, (I do not need touchscreen, so it is not configured) :
in config.txt
# enable touchscreen over SPI
device_tree_param=spi=on
dtoverlay=waveshare35b
cat /etc/modules-load.d/touchscreen.conf
spi-bcm2835
flexfb
fbtft_device
cat /etc/modprobe.d/fbtft.conf
options flexfb regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3 width=480 height=320
options fbtft_device name=flexfb speed=8000000 gpios=reset:25,dc:24 fps=60 txbuflen=32768
cat /etc/X11/xorg.conf.d/99-fbdev-tft35.conf
Section "Device"
#WaveShare SpotPear 3.5", framebuffer 1
Identifier "WaveShare3.5"
driver "fbdev"
Option "fbdev" "/dev/fb1"
Option "ShadowFB" "off"
EndSection
I've tried many configurations :
- changing fbtft_device speed
- using other overlay (piscreen)
- test fbtft_device bgr option
But in all cases color are inverted and refresh rate is very slow.
Here is my kernel :
uname -a
Linux a4h-rpi-coffee-machine 4.14.62-1-ARCH #1 SMP Fri Aug 17 05:43:55 UTC 2018 armv7l GNU/Linux
Something is unclear for me,
in waveshare35b overlay we can see waveshare35b values for parameters init
fps
these parameters are also set in /etc/modprobe.d/fbtft.conf
for flexfb configuration.
It would appear that loading and configuring flexfb fbtft_device
is meaningless. waveshare35b overlay already loads and configure touchscreen. But when I remove /etc/modules-load.d/touchscreen.conf
and /etc/modprobe.d/fbtft.conf
no driver is loaded.
dmesg |grep graphics
dmesg |grep spi
does not return anything.
Moreover waveshare35b is not in device tree :
sudo ls -R /sys |grep wave
returns nothing. I've recompiled dtbo and copied it to /boot/overlays
but it did not change anything.
EDITED : Many thanks @Dirk I've also tried to check logs with vcdbg (to get it on arch :
wget -O vcdbg 'https://github.com/raspberrypi/firmware/blob/master/hardfp/opt/vc/bin/vcdbg?raw=true' && chmod 0755 vcdbg
and got :
002173.385: Failed to load overlay 'waveshare35b'
002173.484: brfs: File read: /mfs/sd/overlays/waveshare35b.dtb
003251.012: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
003361.706: Device tree loaded to 0x2eff9900 (size 0x66b6)
Now I'm investigating it.
sudo vcdbg log msg
to see if the overlay is loaded or not. (assuming you have vcdbg available on arch)