<?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>Simple &amp;quot;Hello World&amp;quot; lvgl label repeating when upgrading from 2.9.1 to 3.0.1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123842/simple-hello-world-lvgl-label-repeating-when-upgrading-from-2-9-1-to-3-0-1</link><description>I have a custom board using a nrf5340 and a st7789 display using spi and mipi_dbi. It&amp;#39;s I have it working on a sample project and printing &amp;quot;Hello World&amp;quot; I was using nrfConnect (Nordic’s VS Code Addin) 2.9.1 which used lvgl 8.*. When I moved the code </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Aug 2025 11:19:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123842/simple-hello-world-lvgl-label-repeating-when-upgrading-from-2-9-1-to-3-0-1" /><item><title>RE: Simple "Hello World" lvgl label repeating when upgrading from 2.9.1 to 3.0.1</title><link>https://devzone.nordicsemi.com/thread/546893?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2025 11:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8bd5a7a-2130-413e-88bb-79cb763fc2a0</guid><dc:creator>lcj</dc:creator><description>&lt;p&gt;CONFIG_LV_CONF_MINIMAL=y caused it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple "Hello World" lvgl label repeating when upgrading from 2.9.1 to 3.0.1</title><link>https://devzone.nordicsemi.com/thread/546528?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2025 16:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27685c02-21b1-40a0-a517-a869fc350e3c</guid><dc:creator>lcj</dc:creator><description>&lt;p&gt;When I do what you recommend:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;            mipi-mode = MIPI_DBI_MODE_SPI_4WIRE;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I get an error on build:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;-- Found devicetree overlay: djboard_nrf5340_cpuapp_310.overlay
devicetree error: /Users/xxxxxxxxx/Projects/GitHub/xxxxxxxxx/pcb1_lvgl/boards/ew/djboard/djboard_nrf5340_cpuapp.dts:57 (column 25): parse error: malformed value
CMake Error at /opt/nordic/ncs/v3.1.0/zephyr/cmake/modules/dts.cmake:306 (execute_process):
  execute_process failed command indexes:&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;line 57 is the line in the dts. If I convert it back to what worked in 2.9.1:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;mipi-mode = &amp;lt;MIPI_DBI_MODE_SPI_4WIRE&amp;gt;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I get this error:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;devicetree.dtlib.DTError: expected property &amp;#39;mipi-mode&amp;#39; on /mipi_dbi/st7789v@0 in /opt/nordic/ncs/v3.1.0/zephyr/misc/empty_file.c to be assigned with &amp;#39;mipi-mode = &amp;quot;string&amp;quot;;&amp;#39;, not &amp;#39;mipi-mode = &amp;lt; 0x2 &amp;gt;;&amp;#39;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Which is why I created a string with it. This should map to something &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/5945a3fcd1eb6fcc704c39fa138ccb724150e6e0/dts/bindings/mipi-dbi/mipi-dbi-device.yaml#L22"&gt;Zephyr&lt;/a&gt;&amp;nbsp;expects, I think.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Here is all the code. Again, this worked in 2.9.1:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/drivers/display.h&amp;gt;
#include &amp;lt;zephyr/pm/device.h&amp;gt;
#include &amp;lt;zephyr/drivers/pwm.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;app_version.h&amp;gt;
#include &amp;lt;lvgl.h&amp;gt;

LOG_MODULE_REGISTER(app, LOG_LEVEL_DBG);

int count = 0;

// BACKLIGHT MANAGER CODE
#define PWM_LED0    DT_ALIAS(pwm_led0)
static const struct pwm_dt_spec pwm_led0 = PWM_DT_SPEC_GET(PWM_LED0);

int backlight_manager_init(void) 
{

	LOG_DBG(&amp;quot;Starting backlight PWM&amp;quot;);

		
	if (!pwm_is_ready_dt(&amp;amp;pwm_led0)) {
		LOG_ERR(&amp;quot;Error: PWM device %s is not ready&amp;quot;, pwm_led0.dev-&amp;gt;name);
		return -1;
	}

    return 0;

}

static void set_pwm(const struct pwm_dt_spec *pwmdev, uint8_t percent) {

	LOG_DBG(&amp;quot;Setting PWM to %d%%&amp;quot;, percent);

	int ret;
	uint32_t step = pwmdev-&amp;gt;period / 100;
	uint32_t pulse_width = step * percent;

	if (!device_is_ready(pwmdev-&amp;gt;dev)) {
		LOG_ERR(&amp;quot;PWM device not ready&amp;quot;);
		return;
	}

	ret = pwm_set_pulse_dt(pwmdev, pulse_width);
	if (ret &amp;lt; 0) {
		LOG_ERR(&amp;quot;Failed to set pulse width: %i&amp;quot;, ret);
		return;
	}
}

void backlight_manager_wake()
{
    set_pwm(&amp;amp;pwm_led0, 100); 
    //set_pwm(&amp;amp;backlight_spec, 1);
}


void backlight_manager_sleep()
{
    set_pwm(&amp;amp;pwm_led0, 0);
}

// DISPLAY MANAGER CODE
static const struct device *display_dev  = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));

int display_manager_init(void) 
{
    LOG_DBG(&amp;quot;Initializing display manager&amp;quot;);
	if (!device_is_ready(display_dev)) {
		LOG_ERR(&amp;quot;Device not ready, aborting test&amp;quot;);
		return 0;
	}

    display_blanking_off(display_dev);

    return 0;
}

// VOLTAGE CODE
int change_gpio_voltage(uint32_t target_voltage)
{
    int err = 0;
    
    uint32_t regout = NRF_UICR-&amp;gt;VREGHVOUT;
    LOG_INF(&amp;quot;change_gpio_voltage: REGOUT = 0x%08x&amp;quot;, regout);
    LOG_INF(&amp;quot;change_gpio_voltage: target voltage is %d&amp;quot;, target_voltage);    
    if ((regout &amp;amp; UICR_VREGHVOUT_VREGHVOUT_Msk)  != target_voltage) {
        LOG_INF(&amp;quot;Target voltage not set. Configuring&amp;quot;);

        // Set NVMC in write mode:
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
        while (NRF_NVMC-&amp;gt;CONFIG != NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos) {
            // Wait...
        }

        // Write the actual UICR Register:
        NRF_UICR-&amp;gt;VREGHVOUT = (target_voltage | ~UICR_VREGHVOUT_VREGHVOUT_Msk);
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy) {
            // Wait...
        }

        // Set NVMC back in read mode:
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
        while (NRF_NVMC-&amp;gt;CONFIG != NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos) {
            // Wait...
        }
        // Check whether it was set successfully:
        if ((NRF_UICR-&amp;gt;VREGHVOUT &amp;amp; UICR_VREGHVOUT_VREGHVOUT_Msk) != target_voltage) {
            err = 0;
        }
        // Reset if success. Config will remain on future reboots.
        if (err == 0) {
            NVIC_SystemReset();
        }
    } else {
        LOG_INF(&amp;quot;Target voltage already set. No action needed.&amp;quot;);
        err = 0;
    }
    return err;

}

// SCREEN HELLO WORLD CODE
static  lv_obj_t *scr_home;

int screen_helloworld_init()
{
	LOG_DBG(&amp;quot;Creating home screen&amp;quot;);

	scr_home = lv_obj_create(NULL);
	// Used this function as it automatically deletes previous screen.
	// Should work as you did also I think. But have not used lv_scr_load_xxx before
	//lv_screen_load_anim(scr_home, LV_SCR_LOAD_ANIM_NONE, 0, 0, true);
	lv_screen_load(scr_home);

	lv_obj_t *hello_world_label;

	lv_obj_set_style_bg_color(lv_scr_act(), lv_palette_main(LV_PALETTE_GREEN), LV_PART_MAIN);
	lv_obj_set_style_text_color(lv_scr_act(), lv_color_white(), LV_PART_MAIN);

	hello_world_label = lv_label_create(lv_scr_act());

	lv_label_set_text(hello_world_label, &amp;quot;Hello World!&amp;quot;);
	lv_obj_align(hello_world_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_text_font(hello_world_label, &amp;amp;lv_font_montserrat_16, LV_PART_MAIN);

	return 0;
}

// SCREEN HELLO WORLD 2CODE
static  lv_obj_t *scr_home2;

int screen_helloworld2_init()
{
	LOG_DBG(&amp;quot;Creating home screen&amp;quot;);

	scr_home2 = lv_obj_create(NULL);
	// Used this function as it automatically deletes previous screen.
	// Should work as you did also I think. But have not used lv_scr_load_xxx before
	lv_screen_load_anim(scr_home2, LV_SCR_LOAD_ANIM_NONE, 0, 0, true);
	//lv_screen_load(scr_home2);

	lv_obj_t *hello_world_label;

	lv_obj_set_style_bg_color(lv_scr_act(), lv_palette_main(LV_PALETTE_GREEN), LV_PART_MAIN);
	lv_obj_set_style_text_color(lv_scr_act(), lv_color_white(), LV_PART_MAIN);

	hello_world_label = lv_label_create(lv_scr_act());

	lv_label_set_text(hello_world_label, &amp;quot;Hello World 2!&amp;quot;);
	lv_obj_align(hello_world_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_text_font(hello_world_label, &amp;amp;lv_font_montserrat_16, LV_PART_MAIN);

	return 0;
}


int main(void)
{
    LOG_DBG(&amp;quot;Hello World! %s (%s)&amp;quot;, CONFIG_BOARD, APP_VERSION_EXTENDED_STRING);
	change_gpio_voltage(UICR_VREGHVOUT_VREGHVOUT_3V0);
	display_manager_init();
	backlight_manager_init();
	screen_helloworld_init();
	backlight_manager_wake();
	while (count &amp;lt; 100) {
		count++;
		LOG_DBG(&amp;quot;looping %d&amp;quot;, count);
		if (count == 50) {
			LOG_DBG(&amp;quot;Let&amp;#39;s load screen 2&amp;quot;);
			screen_helloworld2_init();
		}
		k_sleep(K_MSEC(1000));
		lv_timer_handler();
	}
	backlight_manager_sleep();
	return 0;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I changed it and added a &amp;quot;Hello World 2&amp;quot; screen. At first my screen looked like this:&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1755965891626v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;With the change it looked like this:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1755965976965v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple "Hello World" lvgl label repeating when upgrading from 2.9.1 to 3.0.1</title><link>https://devzone.nordicsemi.com/thread/546422?ContentTypeID=1</link><pubDate>Fri, 22 Aug 2025 08:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e52216b-e147-4381-9e99-a1f1bd3b9c51</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Did you call screen_helloworld_init() in your code apart from once elsewhere in the project? You can r&lt;span&gt;eview your code to ensure you are not creating or loading the screen or label multiple times as display is showing &amp;#39;&amp;#39;Hello World&amp;#39;&amp;#39; 3 times. Check the main function and&amp;nbsp;&lt;code dir="ltr"&gt;lv_screen_load_anim()&lt;/code&gt;&amp;nbsp;to ensure that you are not reloading the same screen multiple times without clearing previous objects.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;DTS looks ok. One thing you need to change&amp;nbsp;for mipi-mode. &lt;code dir="ltr"&gt;mipi-mode&lt;/code&gt;&amp;nbsp;is as an integer, not a string. You need to replace this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;mipi-mode = &amp;quot;MIPI_DBI_MODE_SPI_4WIRE&amp;quot;;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;to&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mipi-mode = MIPI_DBI_MODE_SPI_4WIRE;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kazi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>