What do you want to achieve?
I am trying to display and update a label’s text on the nRF52840-DK and Sharp LS013B7DH05 Memory Display (144x168 px). I am using the nrf connect SDK (v3.0.1) which is based on zephyr v4.0.99 which includes lvgl v9.3.
I am able to show a label’s text on the display, but get a runtime error (bus fault) after updating the label’s text.
Currently, I can create the label and show the text on the screen with no issue, but when I update the label’s text (with lv_label_set_text()
), the application will crash either on the next call to lv_refr_now(NULL)
or an upcoming lv_timer_handler()
call, before the display updates to the new text.
What have you tried so far?
- I’ve tried giving more heap/stack memory to the application/lvgl (in
prj.conf
). - I’ve tried manually initializing lvgl and my display instead of using the NCS/zephyr default initialization
- I’ve ran the application in debug mode and discovered the following, which I believe to be the cause (though I don’t know why this behavior is happening):
- After the text is updated and the display is refreshing, the invalidated area of the display shows width=65534, height=-1 (suggesting integer overflow). This then causes a crash when lvgl attempts to draw to the display.
Code to reproduce
lv_obj_t *test_label = lv_label_create(lv_screen_active());
lv_obj_align(test_label, LV_ALIGN_TOP_LEFT, 0, 0);
lv_label_set_text(test_label, "initial");
lv_timer_handler(); // the display correctly shows the label text
// ... some time later (or immediately after the above) ...
lv_label_set_text(test_label, "changed");
lv_refr_now(NULL); // Runtime error here!
for reference, here is the part of my devicetree overlay to define the sharp display:
/ {
chosen {
zephyr,display = &ls0xx_ls013b7dh05;
};
};
...
&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
ls0xx_ls013b7dh05: ls0xx@0 {
compatible = "sharp,ls0xx";
reg = <0>;
spi-max-frequency = <1100000>;
label = "display";
width = <144>;
height = <168>;
extcomin-gpios = <&gpio1 10 0>;
extcomin-frequency = <60>;
disp-en-gpios = <&gpio1 11 0>;
};
};
Environment
- MCU/MPU/Board: nRF52840-DK
- Display: Sharp Memory Display 144x168 (LS013B7DH05)
- LVGL version: v9.3
- NRF Connect SDK version: v3.0.1
- Zephyr OS version: v4.0.99
Could anyone please help me troubleshoot this? I want to get LVGL working with the nRF52840 and sharp memory display, but I haven’t been able to figure this out and it’s making me pull out my hair.
Thanks!