lvgl sample with SSD1306 and nRF52832 DK not working.

I'm trying to use the LVGL Basic Sample sample and this guide but the SSD1306 128x64 OLED display just shows what's in the picture below instead of "Hello World".

I'm using the nrF52832 DK and pins P0.27 and P0.26 for SCK and SDA. 

This is using the VS Code nrF Connect SDK v2.4.1 platform on Windows.

This is what my overlay file looks like:

/ {
	chosen {
		zephyr,display = &ssd1306_ssd1306_128x64;
	};
};

&pinctrl {
    i2c0_default: i2c0_default {
        group1 {
            psels = <NRF_PSEL(TWIM_SDA, 0, 26)>, 
                <NRF_PSEL(TWIM_SCL, 0, 27)>;     
        };
    };

    i2c0_sleep: i2c0_sleep {
        group1 {
            psels = <NRF_PSEL(TWIM_SDA, 0, 26)>, 
                <NRF_PSEL(TWIM_SCL, 0, 27)>;     
            low-power-enable;
        };
    };
};

arduino_i2c: &i2c0 {
	compatible = "nordic,nrf-twi";
	status = "okay";
	clock-frequency = <I2C_BITRATE_FAST>;
    
  
	ssd1306: ssd1306@3c {
		compatible = "solomon,ssd1306fb";
		reg = <0x3c>;
		width = <128>;
		height = <64>;
		segment-offset = <0>;
		page-offset = <0>;
		display-offset = <0>;
		multiplex-ratio = <63>;
		segment-remap;
		com-invdir;
		prechargep = <0x22>;
	};
};

and my CMakeLists:

cmake_minimum_required(VERSION 3.20.0)
set(SHIELD ssd1306_128x64)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(lvgl)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

and prj.conf:

CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=8
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_DISPLAY=y
CONFIG_I2C=y
CONFIG_DISPLAY_LOG_LEVEL_ERR=y
CONFIG_SSD1306=y
CONFIG_SSD1306_REVERSE_MODE=y

CONFIG_LOG=y

CONFIG_LVGL=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_USE_LOG=y
CONFIG_LV_USE_LABEL=y
CONFIG_LV_USE_BTN=y
CONFIG_LV_USE_IMG=y
CONFIG_LV_FONT_MONTSERRAT_14=y

project:

1030.lvgl.zip

  • Hi Samuel! Susheel has become sick, so I've taken over this case for now. However since multiple colleagues have gotten sick recently, we are a bit overwhelmed by cases at this moment. I'll try to dive into yours as soon as I can - sorry to let you wait further.

    Best regards,

    Raoul

  • Samuel,

    I am sorry for delays. but I got the display which is different from yours. It is an PmodOLED with SPi interface and testing it with the spi overlay and ssd1306_ssd1306_128x32_spi selecting as display makes it work as usual. 

    I am unable to debug the I2C interface as this mod does not have i2c interface. Sorry for not not checking the interface before I ordered, but I do not think that I can test the display you are using on my end.

  • Samuel, My colleague have had the correct display all along.
    I borrowed his display and used your attached changes as it is without any changes in LVGL sample and I can see that the display is working.

    It might be possible that you have a faulty display.

Related