What is drawn when you follow the porting guide?

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Read the

Delete this section if you read and applied the mentioned points.

Description

What MCU/Processor/Board and compiler are you using?

STM32L476RG

What do you want to achieve?

What is drawn when you follow the porting guide?
What is in the buffer and what should be printed on the LCD screen if I follow that guide?

What have you tried so far?

Code to reproduce

Add the relevant code snippets here.

The code block(s) should be between ```c and ``` tags:

/*You code here*/

static lv_disp_draw_buf_t disp_buf;
static lv_color_t buf_1[DISP_BUF_SIZE];

lv_disp_draw_buf_init(&disp_buf, buf_1, NULL, DISP_BUF_SIZE);

lv_disp_drv_init(&disp_drv);

disp_drv.draw_buf = &disp_buf;
disp_drv.flush_cb = my_flush_cb;

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

In flush_cb the lv_color_t * array of colors should be drawn to the lv_area_t area.

Isn’t it empty because the buffer hasn’t been initialized? What color are you filling it with?

The color buffer is filled with the image rendered by LVGL.

What image is rendered?? I do not any image load buffer.

The image for the display.

You are setting up lvgl with elements like buttons, textboxes, rollers, images etc.
lvgl than build up the framebuffer with the ‘image’ which is then transferred by the flush callback function to the display (LCD, OLED etc.).

The question is now, where is the problem of your understanding, and what do you want to know?

If you didn’t create a label or button, I thought if you just created a frame buffer and set it in the driver, there was a garbage value inside the buffer that didn’t contain any value. So I couldn’t figure out what would come out if I displayed the buffer.
Does the callback function put another random value in the frame buffer and display it on the LCD?

I think there should be nothing in it. Just a black screen.
But I never tried.

So if i did not make any object, LCD display anything. Just black screen. right?

I just tried it with the lvgl simulator. Just removed all elements/widgets and the screen shows all white.
Nevertheless I think it should be either white or black without anything else.

I have been porting LVGL as well, nothing will be drawn (black screen) if you don’t tell LVGL to draw anything.
Try pasting the following code after succesfully initializing all that needs to be done:

    /*Change the active screen's background color*/
    lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x003a57), LV_PART_MAIN);

    /*Create a white label, set its text and align it to the center*/
    lv_obj_t * label = lv_label_create(lv_scr_act());
    lv_label_set_text(label, "Hello world");
    lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN);
    lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

from: Examples — LVGL documentation

These examples are quite useful for testing if your port has been succesful.