I am not able to launch GUI using v8.3 in EDK2

lv_init();
lwguilibpkg_hal_activate(&obj_disp,&obj_keyboard,&obj_mouse);
lv_obj_t * btn = lv_btn_create(lv_scr_act()); /Add a button the current screen/
lv_obj_set_pos(btn, 10, 10); /Set its position/
lv_obj_set_size(btn, 120, 50); /Set its size/

lv_obj_t * label = lv_label_create(btn);          /*Add a label to the button*/
lv_label_set_text(label, "Button");                     /*Set the labels text*/
lv_obj_center(label);

Please suggest some changes…GUI doesn’t launch

What is the exact problem?

  • Black screen?
  • Crash? If so where?
  • Compile error? If so please copy it
  • Fire, explosion or other emergency? :slightly_smiling_face:

No compile issues.
No black screen
No crash
The application simply exits without any GUI launch. In v6.1, it was working fine. Ported v8.3, changed the hal_dev.dis_drv.buffer to hal_dev.dis_drv_draw_buf still no effect

Code

#include <lvgl.h>
#include <stdio.h>
#include <lwguilibpkg_hardware_abstraction_layer.h>
#include “lwguilibpkg_system_tick_implementation.h”

#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <time.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/Shell.h>
#include <stdlib.h>
#include <Library/ShellLib.h>
#include <wchar.h>

EFI_SHELL_PROTOCOL *EfiShellProtocol;

EFI_STATUS Status;
BOOLEAN ExitApplication =0;
EFI_HANDLE ImageHandle_dummy;
lv_obj_t *scr = NULL;
lv_disp_t *obj_display;
lv_indev_t *obj_keyboard;
lv_indev_t *obj_mouse;
lv_indev_t *obj_scroll;
lv_obj_t *screen;
lv_obj_t * win;
lv_theme_t *th;

static lv_style_t win_header_style;
//static lv_style_t win_header_button_style;
static lv_style_t win_background_style;

EFI_STATUS
EFIAPI
UefiMain(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable )
{

EFI_STATUS                      Status; 

ImageHandle_dummy = ImageHandle;
Print(L"hello world\n");


lv_init();
Print(L"After init\n");
lwguilibpkg_hal_activate(&obj_display,&obj_keyboard,&obj_mouse,&obj_scroll);
Print(L"After init\n");
#if 0
screen	 = lv_obj_create(lv_scr_act());
Print(L"lv_obj_create\n");
lv_scr_load(screen);
Print(L"lv_scr_load\n");

win = lv_win_create(screen, 100);
Print(L"lv_win_create\n");
lv_win_add_title(win, "Window");
Print(L"lv_win_add_title\n");

th = lv_theme_default_init(obj_display, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), false, LV_FONT_MONTSERRAT_12);
Print(L"lv_theme_default_init\n");
lv_disp_set_theme(obj_display, th);
Print(L"lv_disp_set_theme\n");
//Initialize();
Print(L"Initialize\n");
lv_style_init(&win_header_style);
lv_style_set_bg_color(&win_header_style, lv_palette_main(LV_PALETTE_RED));
lv_style_set_border_color(&win_header_style,lv_palette_main(LV_PALETTE_BLACK));
lv_style_set_border_width(&win_header_style, 1);
lv_style_set_text_color(&win_header_style,lv_palette_main(LV_PALETTE_GREY));
Print(L"Win_header\n");


lv_style_init(&win_background_style);
lv_style_set_bg_color(&win_background_style,  lv_palette_main(LV_PALETTE_BLUE_GREY));
lv_style_set_border_color(&win_background_style,lv_palette_main(LV_PALETTE_BLACK));
lv_style_set_border_width(&win_background_style, 1);
lv_style_set_text_color(&win_background_style, lv_palette_main(LV_PALETTE_BLACK));
Print(L"Win_background\n");
lv_obj_add_style(win, &win_background_style, 0);
Print(L"style\n");
#endif

lv_obj_t * win = lv_win_create(lv_scr_act(), 40);
lv_obj_t * btn;
btn = lv_win_add_btn(win, LV_SYMBOL_LEFT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);

lv_win_add_title(win, "A title");

btn = lv_win_add_btn(win, LV_SYMBOL_RIGHT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);

btn = lv_win_add_btn(win, LV_SYMBOL_CLOSE, 60);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);

lv_obj_t * cont = lv_win_get_content(win);  /*Content can be added here*/
lv_obj_t * label = lv_label_create(cont);
lv_label_set_text(label, "This is\n"
                  "a pretty\n"
                  "long text\n"
                  "to see how\n"
                  "the window\n"
                  "becomes\n"
                  "scrollable.\n"
                  "\n"
                  "\n"
                  "Some more\n"
                  "text to be\n"
                  "sure it\n"
                  "overflows. :)");

#if 1
ExitApplication = FALSE;
while (!ExitApplication) {
	/* Periodically call the lv_task handler.*/
	//lv_task_handler();
	
}
#endif

lwguilibpkg_hal_deactivate();
lwguilibpkg_clear_display();


return Status;

}

I have tried with #if 0 and also the other code which is example 2 as specified. It doesnt give any output.I get prints on EDK2 terminal and it exits