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

Related