lvgl coudn't work in ncs v2.3.0

I use ncs V2.3.0 with NRF52832 on my own board ,not 52832dk board.   I connect one oled(ssd1306 with pixels of 64*32) by i2c1.

when I run my test code, I got the question like this:

after  lv_bar_set_start_value(count_label, 0,LV_ANIM_ON);

I trace the code step by step in  lv_task_handler(),  and in function get_max_row in the file lv_refr.c ,I got into 

 if(h_tmp <= 0) {
            LV_LOG_WARN("Can't set draw_buf height using the round function. (Wrong round_cb or to "
                        "small draw_buf)");
            return 0;
  }
 

my test code is as flow:

void main(void)
{
    uint32_t count = 0U;
    char count_str[11] = {0};
    const struct device *display_dev;
    lv_obj_t *hello_world_label;
    lv_obj_t *count_label;

    //display_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));
    display_dev = device_get_binding("SSD1306");
    if (display_dev == NULL) {
        return;
    }
   
    if (!device_is_ready(display_dev)) {
        LOG_ERR("Device not ready, aborting test");
        return;
    }
    LOG_ERR("Device Ready");

    count_label = lv_bar_create(lv_scr_act());
    lv_obj_align(count_label, LV_ALIGN_BOTTOM_MID, 0, 0);
    lv_bar_set_start_value(count_label, 0,LV_ANIM_ON);

    lv_task_handler();
    display_blanking_off(display_dev);

    while (1) {
        if ((count % 100) == 0U) {
            sprintf(count_str, "%d", count/100U);
            lv_bar_set_value(count_label, count+1, LV_ANIM_ON);
           
        }
        lv_task_handler();
        k_sleep(K_MSEC(10));
        ++count;
    }

}

Parents Reply Children
No Data
Related