Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ILI9488 display patch for SKU: MSP3520, MSP3521, MSP4020, MSP4021

Featured Replies

I am releasing this patch in the hope of you may find it useful. I have also included a sample dts file.  It seems to work in 48mhz quite well with very few SPI errors. (Note that the pieces of the driver has been around for some time but I have never seen it put together without further work. Hopefully this patch would make it readily usable. I have tested it on 5.5.18 and quite happy with it.)

 

 

_4241261.JPG

0001-fbtft-fb_ili9488.patch 1_ili9488.dts

 

Sample file is for nanopi neo.

 

Driver also works with 4 inch LCD, MSP4020, MSP4021

Hi, that is a great news !

  • the provided dts file is for what kind of board ?
  • Do you plan to get the touch to work too ?
  • Author

The colors seem a bit off, I tried fixing it with the following changes. Its a better approximation/mapping and also makes screen brighter but the colors still a bit off. Any ideas?

 

for (i = 0; i < to_copy; i++) {
+            u16 pixel = vmem16;
+            u16 b = pixel & 0x1f;
+            u16 g = (pixel & (0x3f << 5)) >> 5;
+            u16 r = (pixel & (0x1f << 11)) >> 11;
+
+            u8 r8 = ((r & 0x1F)*4*63)/31 + 3;
+            u8 g8 = (g & 0x3F)*4 + 3;
+            u8 b8 = ((b & 0x1F)*4*63)/31 + 3;
+
+            txbuf[i * 3 + 0] = r8;
+            txbuf[i * 3 + 1] = g8;
+            txbuf[i * 3 + 2] = b8;
+        }
 

Thank a lot for your ILI9488 driver. Indeed the colors seem not as they should be.  But this part of code do not work for me at all:

 

On 7/5/2020 at 4:21 AM, yam1 said:

for (i = 0; i < to_copy; i++) {
+            u16 pixel = vmem16;
+            u16 b = pixel & 0x1f;
+            u16 g = (pixel & (0x3f << 5)) >> 5;
+            u16 r = (pixel & (0x1f << 11)) >> 11;
+
+            u8 r8 = ((r & 0x1F)*4*63)/31 + 3;
+            u8 g8 = (g & 0x3F)*4 + 3;
+            u8 b8 = ((b & 0x1F)*4*63)/31 + 3;
+
+            txbuf[i * 3 + 0] = r8;
+            txbuf[i * 3 + 1] = g8;
+            txbuf[i * 3 + 2] = b8;
+        }
 

I'm getting these lines regardless of whether what is located in framebuffer:

Edited by enclis

  • Author

I made a copy of the driver with a different resolution, now it works with 240x240, 1.3", or 1.54", st7789 based tiny displays:

 

st7789-1.jpg.5e622ad72dfaa56316f5a3caadbca24d.jpg

0001-fbtft-fb_st7789.patch

 

The patch contains the brightness fix as mentioned earlier - the colors seem okay on this type of displays.

  • Author

On another note, kernel 5.7 or later is somehow automatically switched to use DRM driver for ili9486 displays - this driver is not working. To work around this I made a copy of the fb ili9486 driver with a different name:

 

 

0001-fbtft-fb_ili9486o.patch

 

 

update: DRM driver is working (slowly) on 5.9, so may be you don't need this patch any more... fbdev drivers seem to take precedence over DRM drivers, so if you leave this in it would still use the fbdev driver -- for drmfb the initialization string seemed not being honored may be the reason why it's so slow

hi
could you please explain how to apply this patch?

 

all im getting is:

$patch < 0001-fbtft-fb_ili9488.patch
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
|index dad1ddcd7..fd27a2dea 100644
|--- a/drivers/staging/fbtft/Kconfig
|+++ b/drivers/staging/fbtft/Kconfig
--------------------------

thanks!!
 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.