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.84k stars 495 forks source link

HardKernel Odroid OGST TFT on Android #577

Closed klandrith closed 2 years ago

klandrith commented 2 years ago

Hello,

I have an Odroid N2 made by HardKernel. I am using an OGST Gaming Case (https://ameridroid.com/products/ogst-gaming-console-case-for-odroid-xu4) that is designed for an Odroid XU4. I am trying to get that built in 2.4" TFT to work. Now here is some basic background info. I am running a custom LineageOS 18.1 image made by a gentleman over on the Odroid forums by the name of voodik. Under /dev/graphics there are 4 framebuffer devices listed. Their resolution as reported by

cat /sys/class/graphics/fb*/virtual_size

is..

1920, 2160 32, 32 32, 32 32, 32

The reason that I mention these devices is that I have no idea what fb1 - 3 refer to.

Now, when I enter the following command over adb,

modprobe -d /vendor/lib/modules fbtft_device name=hktft9340 busnum=0 rotate=270

I get the following dmesg output...

[ 212.921957] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 212.923830] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned. [ 212.924264] spidev spi0.0: spidev spi0.0 100000kHz 8 bits mode=0x00 [ 212.924310] meson-fb meson-fb: meson-fb id=-1 pdata? no [ 212.924343] spidev spi0.0: Deleting spi0.0 [ 212.924632] spi spi0.0: setup mode 0, 8 bits/w, 40000000 Hz max --> 0 [ 212.924747] meson-spicc ffd13000.spi: registered child spi0.0 [ 212.924750] fbtft_device: GPIOS used by 'hktft9340': [ 212.924752] fbtft_device: 'reset' = GPIO480 [ 212.924754] fbtft_device: 'dc' = GPIO483 [ 212.924755] fbtft_device: 'led' = GPIO473 [ 212.924759] spi spi0.0: fb_ili9340 spi0.0 40000kHz 8 bits mode=0x00 [ 214.249383] ffs_retry_malloc_buffer

As can be seen, there is never an additional framebuffer device that is ceated...

odroidn2:/dev/graphics # ls /dev/graphics fb0 fb1 fb2 fb3

...and the fb1-3 devices report the same display size, so fbtft is not binding to one of them.

I haven't been able to readily find any real info on doing this under Android. Odroid had this working under Android with their XU4 boards, but I haven't been able to find any real details on how they got that working. Any ideas?

notro commented 2 years ago

The task of fbtft_device is to add a device describing the display. In your case this is the device added:

[ 212.924759] spi spi0.0: fb_ili9340 spi0.0 40000kHz 8 bits mode=0x00

On most systems the fb_ili9340 module/driver would be loaded automatically by udev when the device is added and the driver would register the framebuffer. You could try loading the module manually: modprobe -d /vendor/lib/modules fb_ili9340

klandrith commented 2 years ago

Thanks for the help! That did the trick and created a framebuffer device and initiated the display with the backlight coming on. I haven't gotten it to display anything yet though. I'm attempting to compile a static version of mplayer for my purposes. Thanks again!

klandrith commented 2 years ago

I seem to be still having a problem, at least according to what you posted in another issue thread. As soon as the framebuffer device is created after issuing modprobe -d /vendor/lib/modules fb_ili9340 the screen goes blank white with the backlight on. It is my understanding that it is supposed to go blank black? Correct? I'm double and triple checking all of my wiring, but it all looks to be correct.

klandrith commented 2 years ago

So, I'm unsure how to do this from the command line calling fbtft_device via modprobe. The following are the default pins for my board...

[ 781.757402] fbtft_device: 'reset' = GPIO480 [ 781.757404] fbtft_device: 'dc' = GPIO483 [ 781.757405] fbtft_device: 'led' = GPIO473

However, pins 480 and 483 are active low, while 473 is active high. I do not know if the hktft9340 module "knows" this or not. If it doesn't, I would presume that is my problem with the display not initializing correctly and the reason for the blank white screen after fb_ili9340 loading. How can I specify the pin state when I load fbtft_device via modprobe. I know to specify the pin is gpios=reset:480....etc...

notro commented 2 years ago

the screen goes blank white with the backlight on.

This is a typical controller that has not been initialized correctly.

How can I specify the pin state when I load fbtft_device via modprobe.

fbtft_device can't do that. It's possible when adding the device through Device Tree, but things have changed over the years and I'm not sure about this, it might depend on the kernel version.

reset should be active high in old fbtft and active low since Linux 5.3: https://github.com/torvalds/linux/commit/b918d1c2706619cb0712a61cc8c05148b68b24b2 dc and led should be active high.

klandrith commented 2 years ago

Ok...I've double and triple checked my wiring and labeled everything and re-hooked it all up. I am loading the following....

modprobe -d /vendor/lib/modules fbtft_device name=hktft9340 busnum=0 rotate=270 gpios=reset:472,led:473,dc:482 modprobe -d /vendor/lib/modules fb_ili9340

Now before I load the modules, gpio readall reports the following...

I/O 484 - wPi 12 - MOSI - ALT4 - 1 I/O 485 - wPi 13 - MISO - ALT4 - 1 I/O 487 - wPi 14 - SCLK - ALT4 - 1 I/O 486 - wPi 10 - CE0 - OUT - 1

I/O 472 - wPi 26 - IO.472 - IN - 0 (Reset) I/O 473 - wPi 7 - IO.473 - IN - 0 (LED) I/O 482 - wPi 24 - IO.482 - IN - 0 (DC)

And after loading the above modules with those parameters I get...

I/O 484 - wPi 12 - MOSI - ALT4 - 0 I/O 485 - wPi 13 - MISO - ALT4 - 1 I/O 487 - wPi 14 - SCLK - ALT4 - 0 I/O 486 - wPi 10 - CE0 - OUT - 1

I/O 472 - wPi 26 - IO.472 - IN - 1 (Reset) I/O 473 - wPi 7 - IO.473 - IN - 1 (LED) I/O 482 - wPi 24 - IO.482 - IN - 1 (DC)

So, that still gets me a blank back lit white screen. So, I got a hold of the HardKernel dtbo file and initialized fbtft_device with the values and arguments present in it. modprobe -d /vendor/lib/modules fbtft_device name=hktft9340 reg=0 pinctrl-names="default" pinctrl-0=1 speed=32000000 busnum=0 rotate=270 bgr=1 backlight=1 fps=20 bpp=16 buswidth=8 gpios=reset:472,led:473,dc:482 debug=7

Followed by the same modprobe -d /vendor/lib/modules fb_ili9340

Which yielded me the same thing, and the following dmesg output.

[ 234.541364] fbtft_device: unknown parameter 'reg' ignored [ 234.541366] fbtft_device: unknown parameter 'pinctrl-names' ignored [ 234.541368] fbtft_device: unknown parameter 'pinctrl-0' ignored [ 234.541374] fbtft_device: unknown parameter 'backlight' ignored [ 234.541376] fbtft_device: unknown parameter 'bpp' ignored [ 234.541566] spidev spi0.0: spidev spi0.0 100000kHz 8 bits mode=0x00 [ 234.541614] meson-fb meson-fb: meson-fb id=-1 pdata? no [ 234.541648] spidev spi0.0: Deleting spi0.0 [ 234.541925] spi spi0.0: setup mode 0, 8 bits/w, 32000000 Hz max --> 0 [ 234.542041] meson-spicc ffd13000.spi: registered child spi0.0 [ 234.542045] fbtft_device: GPIOS used by 'hktft9340': [ 234.542046] fbtft_device: 'reset' = GPIO472 [ 234.542048] fbtft_device: 'led' = GPIO473 [ 234.542049] fbtft_device: 'dc' = GPIO482 [ 234.542053] spi spi0.0: fb_ili9340 spi0.0 32000kHz 8 bits mode=0x00 [ 245.375328] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 245.376168] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned. [ 245.376596] fb_ili9340 spi0.0: fbtft_request_gpios_match('reset') [ 245.376613] fb_ili9340 spi0.0: fbtft_request_gpios: 'reset' = GPIO472 [ 245.376615] fb_ili9340 spi0.0: fbtft_request_gpios_match('led') [ 245.376621] fb_ili9340 spi0.0: fbtft_request_gpios: 'led' = GPIO473 [ 245.376623] fb_ili9340 spi0.0: fbtft_request_gpios_match('dc') [ 245.376629] fb_ili9340 spi0.0: fbtft_request_gpios: 'dc' = GPIO482 [ 245.376631] fb_ili9340 spi0.0: fbtft_verify_gpios() [ 245.376633] fb_ili9340 spi0.0: fbtft_reset() [ 245.496665] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: ef 03 80 02 [ 245.496671] fb_ili9340 spi0.0: fbtft_write_spi(len=1): ef [ 245.502050] fb_ili9340 spi0.0: fbtft_write_spi(len=3): 03 80 02 [ 245.502079] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: cf 00 c1 30 [ 245.502083] fb_ili9340 spi0.0: fbtft_write_spi(len=1): cf [ 245.502105] fb_ili9340 spi0.0: fbtft_write_spi(len=3): 00 c1 30 [ 245.502127] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: ed 64 03 12 81 [ 245.502131] fb_ili9340 spi0.0: fbtft_write_spi(len=1): ed [ 245.502152] fb_ili9340 spi0.0: fbtft_write_spi(len=4): 64 03 12 81 [ 245.502174] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: e8 85 00 78 [ 245.502177] fb_ili9340 spi0.0: fbtft_write_spi(len=1): e8 [ 245.502199] fb_ili9340 spi0.0: fbtft_write_spi(len=3): 85 00 78 [ 245.502220] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: cb 39 2c 00 34 02 [ 245.502223] fb_ili9340 spi0.0: fbtft_write_spi(len=1): cb [ 245.502244] fb_ili9340 spi0.0: fbtft_write_spi(len=5): 39 2c 00 34 02 [ 245.502266] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: f7 20 [ 245.502269] fb_ili9340 spi0.0: fbtft_write_spi(len=1): f7 [ 245.502290] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 20 [ 245.502311] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: ea 00 00 [ 245.502314] fb_ili9340 spi0.0: fbtft_write_spi(len=1): ea [ 245.502335] fb_ili9340 spi0.0: fbtft_write_spi(len=2): 00 00 [ 245.502355] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: c0 23 [ 245.502358] fb_ili9340 spi0.0: fbtft_write_spi(len=1): c0 [ 245.502379] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 23 [ 245.502399] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: c1 10 [ 245.502402] fb_ili9340 spi0.0: fbtft_write_spi(len=1): c1 [ 245.502423] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 10 [ 245.502442] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: c5 3e 28 [ 245.502445] fb_ili9340 spi0.0: fbtft_write_spi(len=1): c5 [ 245.502466] fb_ili9340 spi0.0: fbtft_write_spi(len=2): 3e 28 [ 245.502486] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: c7 86 [ 245.502489] fb_ili9340 spi0.0: fbtft_write_spi(len=1): c7 [ 245.502510] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 86 [ 245.502529] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 3a 55 [ 245.502532] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 3a [ 245.502553] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 55 [ 245.502573] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: b1 00 18 [ 245.502576] fb_ili9340 spi0.0: fbtft_write_spi(len=1): b1 [ 245.502597] fb_ili9340 spi0.0: fbtft_write_spi(len=2): 00 18 [ 245.502617] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: b6 08 82 27 [ 245.502620] fb_ili9340 spi0.0: fbtft_write_spi(len=1): b6 [ 245.502640] fb_ili9340 spi0.0: fbtft_write_spi(len=3): 08 82 27 [ 245.502662] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: f2 00 [ 245.502665] fb_ili9340 spi0.0: fbtft_write_spi(len=1): f2 [ 245.502686] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 00 [ 245.502706] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 26 01 [ 245.502709] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 26 [ 245.502730] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 01 [ 245.502750] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: e0 0f 31 2b 0c 0e 08 4e f1 37 07 10 03 0e 09 00 [ 245.502753] fb_ili9340 spi0.0: fbtft_write_spi(len=1): e0 [ 245.502774] fb_ili9340 spi0.0: fbtft_write_spi(len=15): 0f 31 2b 0c 0e 08 4e f1 37 07 10 03 0e 09 00 [ 245.502803] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: e1 00 0e 14 03 11 07 31 c1 48 08 0f 0c 31 36 0f [ 245.502806] fb_ili9340 spi0.0: fbtft_write_spi(len=1): e1 [ 245.502828] fb_ili9340 spi0.0: fbtft_write_spi(len=15): 00 0e 14 03 11 07 31 c1 48 08 0f 0c 31 36 0f [ 245.502856] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 11 [ 245.502859] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 11 [ 245.622885] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 29 [ 245.622892] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 29 [ 245.622925] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 36 28 [ 245.622928] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 36 [ 245.622994] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 28 [ 245.623021] fb_ili9340 spi0.0: fbtft_update_display(start_line=0, end_line=239) [ 245.623024] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 2a 00 00 01 3f [ 245.623027] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 2a [ 245.623049] fb_ili9340 spi0.0: fbtft_write_spi(len=4): 00 00 01 3f [ 245.623071] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 2b 00 00 00 ef [ 245.623075] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 2b [ 245.623095] fb_ili9340 spi0.0: fbtft_write_spi(len=4): 00 00 00 ef [ 245.623117] fb_ili9340 spi0.0: fbtft_write_reg8_bus8: 2c [ 245.623120] fb_ili9340 spi0.0: fbtft_write_spi(len=1): 2c [ 245.623141] fb_ili9340 spi0.0: fbtft_write_vmem16_bus8(offset=0, len=153600) [ 245.623150] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.626368] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.629546] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.632723] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.635904] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.639097] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.642328] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.645522] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.648697] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.651905] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.655098] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.658348] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.661545] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.664739] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.667927] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.671113] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.674363] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.677591] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.680790] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.683973] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.687183] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.690381] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.693653] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.696861] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.700061] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.703252] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.706453] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.709727] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.712935] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.716138] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.719306] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.722519] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.725787] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.728987] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.732190] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.735382] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.738579] fb_ili9340 spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.741845] fb_ili9340 spi0.0: fbtft_write_spi(len=2048): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... [ 245.743468] fb_ili9340 spi0.0: Display update: 1245 kB/s, fps=0 [ 245.749313] graphics fb4: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=20, spi0.0 at 32 MHz [ 245.749322] fb_ili9340 spi0.0: fbtft_backlight_update_status: polarity=1, power=0, fb_blank=0 [ 260.731800] ffs_retry_malloc_buffer

Then I figured I would do some research on the Amlogic SPICC controller module. I found that it only supports up to 30mhz, so I tried dropping the bus speed down to 30mhz, then 20mhz, and then 10mhz, and got the same result as well. Not quite sure what to try now.

BTW: This build of android is using kernel 4.9, so I assume the led output should be active high per your previous comment.

Thanks again for the help.

notro commented 2 years ago

I/O 472 - wPi 26 - IO.472 - IN - 1 (Reset) I/O 473 - wPi 7 - IO.473 - IN - 1 (LED) I/O 482 - wPi 24 - IO.482 - IN - 1 (DC)

This doesn't look right, IN?

You could try and see if backlight can be toggled by writing 0 and 4 to /sys/class/backlight//bl_power

I don't know what else to try except looking at the wires with a scope.

klandrith commented 2 years ago

Ugh, my bad, typo. They switch to out after initialization. I am able to write directly to the backlight pin and toggle it on and off. I got a reply on the Odroid forum from one of the devs behind some software for the Odroid-Go handheld, that uses the same small 2.4" TFT. He stated that the display in that with the init sequence he has will always display white until something is written to it. I presume that the hktft9340 display type uses the same init sequence and that that is why I am getting the white display.

Now I just need to get a build of ffmpeg or mplayer setup for android so I can test it out. The builds of ffmpeg that I found, for some reason, refused to write directly to the framebuffer and claimed it was an invalid output format.

Thank you again for all the help! I really appreciate it. Have good weekend.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.