why is this happening? it doesn’t seem right.
i should mention the other elements of the struct seem to be initiated correctly pointing to valid memory
my initialization code
ili9488_init();
disp_bl_init(2000);
disp_bl_set(0.5);
lv_init();
static lv_disp_buf_t disp_buf_2;
static lv_color_t buf2_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
static lv_color_t buf2_2[LV_HOR_RES_MAX * 10]; /*An other buffer for 10 rows*/
lv_disp_buf_init(&disp_buf_2, buf2_1, buf2_2, LV_HOR_RES_MAX * 10); /*Initialize the display buffer*/
lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
/*Set the resolution of the display*/
disp_drv.hor_res = 480;
disp_drv.ver_res = 320;
/*Used to copy the buffer's content to the display*/
disp_drv.flush_cb = disp_flush;
/*Set a display buffer*/
disp_drv.buffer = &disp_buf_2;
/*Finally register the driver*/
lv_disp_drv_register(&disp_drv);
You need to find why the pointer returned from lv_obj_create is 0xaaaaaaaa. Probably worth stepping through that function and checking the return value of lv_mem_alloc, not the contents of the pointer.
well, this is weird, and could explain this whole issue
this line does no exist in my code, i don’t know why, i haven’t edited it, at least not on purpose. disp->act_scr = lv_obj_create(NULL, NULL); /*Create a default screen on the display*/
like i said i found it really weird that nothing attemped to initialize that element, ever, before trying to read something from, it didn’t make sense.
update, i guess this was the issue, it runs fine now, i haven’t tested any drawing yet, but right now i don’t have time.
At least the Bus Fault is no more!
I guess that line was missing all along, i have no idea how this happen.
All allocated data is initialized to 0xaaaa... and all freed data is set to 0xbbbb... by default if LV_MEM_ADD_JUNK 1 in lv_mem.c.
I enabled it in the latest release because there were some issues with using the already freed memory and I wanted to get feedback in this regard. However these issues seems solved so LV_MEM_ADD_JUNK can be disabled.
That’s a bad sign. It means that what you downloaded must be corrupt (or you accidentally deleted the line). To avoid that problem in the future I recommend cloning the repository with git; that way you know if you changed something from the original.
i use git.
but i did change the “folder structure” in order to fit with my project/programming style, and somewhere along the way i somehow deleted that line.
i will verify the integrity of the files just to make sure
I would advise you to avoid changing the folder structure of the lvgl folder itself. That will make it harder to update easily (by just running git pull).