<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122915/lvgl-sample-failing-to-display-properly-on-sharp-displayl</link><description>Hello, I am using the nRF54L15 board, and trying to connect to the Adafruit SHARP 400x240 monochrome LCD display . 
 I got the display driver alone to function just fine after a while, but when I attempted to implement LVGL in the project using the Zephyr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Mar 2026 21:41:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122915/lvgl-sample-failing-to-display-properly-on-sharp-displayl" /><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/564218?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2026 21:41:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fa7afa9-967c-48a9-8979-92bebc706b63</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Is this still the issue with nRF Connect SDK version&amp;nbsp;3.2.3?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/544807?ContentTypeID=1</link><pubDate>Wed, 06 Aug 2025 14:05:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a88259b-0c0a-4ad9-9aed-ccd4c96eeaff</guid><dc:creator>Zeke</dc:creator><description>&lt;p&gt;Thanks for all the help, but I have actually found out that it is the&amp;nbsp;display buffer held for the monochrome display that wound up being too large. The memory reserves 8&amp;nbsp;bytes for the palette, so the memory kept 8 extra&amp;nbsp;bytes in memory, but what I did not know was that these already had skipped the palette bytes, so the 8 bytes were leaking into&amp;nbsp;other parts of the memory.&lt;/p&gt;
&lt;p&gt;All I had to do was alter a function in the file&amp;nbsp;&lt;em&gt;lvgl_display_mono.c&lt;/em&gt;&amp;nbsp;to ensure the right size buffer.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void lvgl_set_mono_conversion_buffer(uint8_t *buffer, uint32_t buffer_size)
{
	mono_conv_buf = buffer;
	
	// 8 palette bytes do not need to be altered
+	mono_conv_buf_size = buffer_size - 8;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/544102?ContentTypeID=1</link><pubDate>Wed, 30 Jul 2025 13:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd2e8be0-07f0-49f6-a2c3-cf4ba04e00b4</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kazi is out of the office, so I take this case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am no expert in LVGL, but my colleague has just been doing display_write&amp;nbsp;makes LVGL take one buffer 16 or 18 bit. It seems like on 1bpp display, he was trying to read this discussion in the github issue number&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/lvgl/lvgl/issues/1427"&gt;1427&lt;/a&gt;&lt;span&gt;&amp;nbsp;and it is possible that&amp;nbsp;your LVGL buffer stays all 0x00 (black) because LVGL is writing a single‐bit brightness into each lv_color_t (which ends up in the LSB), and then the Zephyr flush simply spits out those bytes without repacking them into MSB-first pixel order. You might need to pack 8 pixels into one byte from MSB to LSB something like below&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;+#include &amp;lt;lvgl.h&amp;gt;
 #include &amp;lt;stdio.h&amp;gt;

-static void flush_cb(struct _disp_drv_t *disp_drv,
-                     const lv_area_t *area,
-                     lv_color_t *color_map)
-{
-    display_write(display_dev,
-                  area-&amp;gt;x1, area-&amp;gt;y1,
-                  &amp;amp;disp_buf_desc,
-                  (const void *)color_map);
-    lv_disp_flush_ready(disp_drv);
-}
+static void sharp_flush_cb(lv_disp_drv_t *drv,
+                           const lv_area_t *area,
+                           lv_color_t *buf)
+{
+    int w = area-&amp;gt;x2 - area-&amp;gt;x1 + 1; // important change, pack 8 LVGL pixels into 1 byte
+    uint8_t line[400/8];
+
+    for (int y = area-&amp;gt;y1; y &amp;lt;= area-&amp;gt;y2; y++) {
+        memset(line, 0, sizeof(line));
+        for (int x = 0; x &amp;lt; w; x++) {
+            if (lv_color_brightness(buf[x + (y-area-&amp;gt;y1)*w]) &amp;gt; 128) {
+                line[x&amp;gt;&amp;gt;3] |= 0x80 &amp;gt;&amp;gt; (x&amp;amp;7);
+            }
+        }
+        display_write(display_dev, area-&amp;gt;x1, y, &amp;amp;row_desc, line);
+    }
+    lv_disp_flush_ready(drv);
+}
+
+static struct display_buffer_descriptor row_desc = {
+    .pitch = 400,
+    .height = 1,
+    .buf_size = 400/8,
+};
+
+void main(void)
+{
+    disp_dev = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_display)));
+    if (!device_is_ready(disp_dev)) return;
+
+    lv_init();
+
+    static uint8_t buf[400*240/8 + 8];
+    static lv_disp_draw_buf_t draw_buf;
+    lv_disp_draw_buf_init(&amp;amp;draw_buf, buf, NULL, sizeof(buf));
+
+    lv_disp_drv_t disp_drv;
+    lv_disp_drv_init(&amp;amp;disp_drv);
+    disp_drv.hor_res = 400;
+    disp_drv.ver_res = 240;
+    disp_drv.draw_buf = &amp;amp;draw_buf;
+    disp_drv.flush_cb = sharp_flush_cb;
+    disp_drv.color_format = LV_COLOR_FORMAT_I1;
+    lv_disp_drv_register(&amp;amp;disp_drv);
+
+    lv_obj_t *lbl = lv_label_create(lv_scr_act());
+    lv_label_set_text(lbl, &amp;quot;Hello world!&amp;quot;);
+    lv_obj_align(lbl, LV_ALIGN_CENTER, 0, 0);
+
+    while (1) {
+        lv_timer_handler();
+        k_sleep(K_MSEC(10));
+    }
+}
 
-void main(void)
-{
-    display_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));
-    if (!device_is_ready(display_dev)) {
-        LOG_ERR(&amp;quot;Device not ready, aborting&amp;quot;);
-        return;
-    }
-
-    lv_init();
-    lv_disp_draw_buf_init(&amp;amp;draw_buf, buf, NULL, sizeof(buf));
-    lv_disp_drv_init(&amp;amp;disp_drv);
-    disp_drv.hor_res = 400;
-    disp_drv.ver_res = 240;
-    disp_drv.draw_buf = &amp;amp;draw_buf;
-    disp_drv.flush_cb = flush_cb;
-    lv_disp_drv_register(&amp;amp;disp_drv);
-
-    /* … rest of sample … */
-}&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;instead of using Zephyr LVGL handling, he is using lv_disp_drv API here, use it as a template.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/543650?ContentTypeID=1</link><pubDate>Fri, 25 Jul 2025 22:02:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0510c011-1128-4a13-9f28-a57cab742d9d</guid><dc:creator>Zeke</dc:creator><description>&lt;p&gt;Hello Kazi,&lt;/p&gt;
&lt;p&gt;The board is the nRF54L15 DK. I do not know quite what you mean by application file, but I have added everything needed to reproduce the issue. I have attached a zip folder as well with the files.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/lvgl_5F00_2025.zip"&gt;devzone.nordicsemi.com/.../lvgl_5F00_2025.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/543543?ContentTypeID=1</link><pubDate>Thu, 24 Jul 2025 14:27:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:612453b8-0046-41c1-82f1-6468dd254f09</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Zeke,&lt;/p&gt;
&lt;p&gt;Is this a custom board? Could you please share the application file so I can try to reproduce the issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/542689?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 22:04:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e97bf484-a275-435b-b82b-e0ad03a431b1</guid><dc:creator>Zeke</dc:creator><description>&lt;p&gt;If you are referring to the LCD, the board is a LS0XX board, one&amp;nbsp;which the driver&amp;nbsp;had already come with the install of Zephyr and nRF Connect. When building the project, I use the nrf54l15/nrf54l15/cpuapp board target.&lt;/p&gt;
&lt;p&gt;I am also using ncs v3.0.2.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LVGL sample failing to display properly on SHARP displayl</title><link>https://devzone.nordicsemi.com/thread/542605?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 07:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9782469e-c62c-4c2a-99be-61f3e17f6ae6</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The Bus error seems display driver is not fully compatible with the zephyr display API as expected by LVGL which results a NULL or invalid function pointer dereference in display_write().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is this a custom board? which NCS you are working on?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>