facing issue while using LVGL sample with ssd1306 oled display

I hope this message finds you well.

I am currently encountering an issue while attempting to use an LVGL (LittlevGL) sample code with an SSD1306 OLED display. I have followed the instructions provided in the LVGL documentation and attempted to run the sample code on my setup, but I am encountering difficulties in getting the display to work as expected.

Specifically, the issues I am facing include:

  1. Display Initialization: I am having trouble initializing the SSD1306 OLED display correctly with LVGL. Despite following the sample code and documentation, the display remains blank or shows unexpected behavior.

  2. Communication Protocol: I am unsure whether the SPI or I2C communication protocol should be used for interfacing the SSD1306 OLED display with LVGL. I have attempted both approaches but have not been successful in getting the display to function properly.

  3. Code Compatibility: I am using the latest version of LVGL and have downloaded the sample code provided for SSD1306 displays. However, I suspect there may be compatibility issues or configuration settings that need to be adjusted for my specific setup.

  4. Troubleshooting Steps: I have attempted to debug the issue by checking the wiring connections, reviewing the LVGL documentation, and searching for similar issues online. However, I have not been able to identify the root cause of the problem.

If any members of the DevZone community have experience with LVGL and SSD1306 OLED displays or have encountered similar issues in the past, I would greatly appreciate any guidance, advice, or troubleshooting steps you can provide.

Additionally, if anyone has successfully implemented LVGL with an SSD1306 OLED display and has access to working code examples or configuration settings, I would be grateful for any assistance in this regard.

Thank you in advance for your support and expertise. Your insights will be instrumental in helping me overcome this challenge and move forward with my project.

Best regards, Aman

  • Hi,

    Display Initialization: I am having trouble initializing the SSD1306 OLED display correctly with LVGL. Despite following the sample code and documentation, the display remains blank or shows unexpected behavior.

    Can you provide a link to the exact sample code you are using? Which SDK version are you using for building?

    Code Compatibility: I am using the latest version of LVGL and have downloaded the sample code provided for SSD1306 displays. However, I suspect there may be compatibility issues or configuration settings that need to be adjusted for my specific setup.

    What is the exact model of your display? Are you sure it is SSD1306 and not the very similar SH1106 display? If you are using nRF Connect SDK and the SSD1306 driver, you can set an option to support SH1106, see Zephyr 3.5 migration guide:

    "CONFIG_SSD1306_SH1106_COMPATIBLE was used to assert that the device is (compatible with) SH1106. This has been replaced by a dedicated dts compatible declaration. You may update an existing sh1106 node to change the compatible designation from solomon,ssd1306fb to sinowealth,sh1106."

    The Zephyr Display sample should work with SSD1306. Have you tried this to see that the display works correctly without LVGL?

    Best regards,
    Jørgen

  •   WORKING_oled.zip

    i have used the LVGL sample provided by zephyr samples and i was using ssd1306 & i am not able to increase its black strip size to display  complete sentence could you explain where i am getting wrong

  • Hi,

    I'm seeing similar behavior on my display. I get correct output with these changes:

    In prj.conf, add this to support SH1106 display:

    CONFIG_SSD1306_SH1106_COMPATIBLE=y

    Modify width to match SH1106 display in nrf52dk_nrf52832.overlay file:

    width = <132>;

    I main.c, add parentheses around calculation to place in middle of display:

    uint16_t start_y = (display_height - text_height)/2;

    When built with nRF Connect SDK v2.5.0 this is the output on my display:

    oled2.zip

    Best regards,
    Jørgen

Related