rm-hull / st7735fb

Schematics and build info for assembling a custom Raspberry Pi kernel with ST7735 TFT-LCD framebuffer drivers
29 stars 5 forks source link

Kernel compilation #1

Open thijstriemstra opened 7 years ago

thijstriemstra commented 7 years ago

One of these 1.44" Serial LCD Display 128*128 SPI TFT Color Screen With PCB Adapter 5110 recently arrived. The instructions mention "Drive IC using ST7735S , stable and reliable, it shows simple adjustment!". So this library should be compatible right? Is it still necessary to cross-compile a custom kernel?

rm-hull commented 7 years ago

So this README is probably way out of date - it did work on the 3.8 and 3.9 kernel lines, but I havent kept it up-to-date with any recent kernel, mainly because a lot of effort was put in by Noralf Tronnes + contributors (see https://github.com/notro/fbtft) to build custom framebuffers for a number of different LCD devices. As far as I am aware they are all in the RPi kernel now.

So then answer to:

Is it still necessary to cross-compile a custom kernel?

is no; I think you should just be able to modprobe the relevant kernel module.

The answer for:

So this library should be compatible right?

is, probably - the ST7735R and ST7735S are sufficiently similar so they should work. However, if it were me I wouldn't try to necromance that version of the kernel, instead I would follow the instructions here https://github.com/notro/fbtft/wiki relating to the fb_st7735r driver.

thijstriemstra commented 7 years ago

But this page mentions 'FBTFT is a dead end'. And "The FBTFT drivers are now in the Linux kernel".

thijstriemstra commented 7 years ago

And it's indeed in there but how would I activate this: https://github.com/torvalds/linux/blob/master/drivers/staging/fbtft/fb_st7735r.c

rm-hull commented 7 years ago

The repo is dead, but the docs are still relevant. Look at this: https://github.com/notro/fbtft/wiki#step-by-step-using-fbtft

You should be able to do something like sudo modprobe fbtft_device name=adafruit18 to initialize the device and then dmesg - the adafruit18 is probably the nearest to what you have.

thijstriemstra commented 7 years ago

I see! dmesg shows:

fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[  933.364855] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[  933.365860] spidev spi0.0: spidev spi0.0 500kHz 8 bits mode=0x00
[  933.365882] spidev spi0.1: spidev spi0.1 500kHz 8 bits mode=0x00
[  933.365918] bcm2708_fb soc:fb: soc:fb id=-1 pdata? no
[  933.365965] spidev spi0.0: Deleting spi0.0
[  933.367389] fbtft_device: GPIOS used by 'adafruit18':
[  933.367413] fbtft_device: 'reset' = GPIO25
[  933.367424] fbtft_device: 'dc' = GPIO24
[  933.367431] fbtft_device: 'led' = GPIO18
[  933.367450] spidev spi0.1: spidev spi0.1 500kHz 8 bits mode=0x00
[  933.367465] spi spi0.0: fb_st7735r spi0.0 32000kHz 8 bits mode=0x00
[  933.375343] fb_st7735r: module is from the staging directory, the quality is unknown, you have been warned.
[  934.270358] graphics fb1: fb_st7735r frame buffer, 128x160, 40 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 32 MHz

Testing again..

thijstriemstra commented 7 years ago

It looks like it's working... or doing something at least because there's something on the screen. Unfortunately the crack in the display is now also visible, probably happend during shipping, so I'll contact the seller.

foo

Wiring: