Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Data on the LCD #24

Closed
MyVanitar opened this issue Apr 21, 2021 · 18 comments
Closed

No Data on the LCD #24

MyVanitar opened this issue Apr 21, 2021 · 18 comments

Comments

@MyVanitar
Copy link

MyVanitar commented Apr 21, 2021

Hi,

I used the library with this code:

extern const uint8_t mygif_map[];

.
.
.
.


lv_obj_t * par = lv_obj_create(lv_scr_act(), NULL); /*Create a parent object on the current screen*/
lv_obj_set_size(par, 320, 240);
lv_obj_t * img = lv_gif_create_from_data(par, mygif_map);

However, the LCD shows this:

20210421_182148

@kisvegabor
Copy link
Member

kisvegabor commented Apr 21, 2021 via email

@MyVanitar
Copy link
Author

Hi,

Yes, I have opened the issue at the right address, which is here. I attached the original gif.

mygif

@kisvegabor
Copy link
Member

Uh sorry. Somehow I thought it's an email, not a GitHub notification... 😅

I'll test it tomorrow.

@kisvegabor
Copy link
Member

I've checked it and I see the gif but it freezes after ~10 frames. It seems it's a bug in the gif decoder.
I've opened an issue for it lecram/gifdec#13

Does the decoder work with the example gif?
https://github.com/lvgl/lv_lib_gif/blob/master/example_gif.c

@MyVanitar
Copy link
Author

I first tested this on the CodeBlock, as you said it freezes after the frames finish and when it tries to re-start the frames. I have not tested the example gif. I will do and inform you.
For this experiment (my own gif), I don't know what hardware do you use, In my case, RAM and FLASH memories were not full, however, I received that message on the LCD. reason is unkown

@MyVanitar
Copy link
Author

I tested the example GIF. it shows it on the screen, but no animation.

20210422_190049

@MyVanitar
Copy link
Author

This is memory consumption information for the example gif:

2021-04-22_19-07-50

@kisvegabor
Copy link
Member

I first tested this on the CodeBlock, as you said it freezes after the frames finish and when it tries to re-start the frames. I have not tested the example gif. I will do and inform you.

For me, it froze after 12 frames but the gif has > 20 frames.

Please enable LVGL's logging in lv_conf.h with LV_LOG_WARN level and post the result.

@MyVanitar
Copy link
Author

For me, it froze after 12 frames but the gif has > 20 frames.
Please enable LVGL's logging in lv_conf.h with LV_LOG_WARN level and post the result.

Should I test with which gif file, the example gif, or my own gif?
on the hardware or on the CodeBlock?

@kisvegabor
Copy link
Member

With the example gif please, to find out why it doesn't run.

@MyVanitar
Copy link
Author

Okay. I enabled the LVGL log like this with printf

2021-04-26_18-41-43

I received these two warning in the console when the tracer:

Warn: Couldn't allocate memory 	(lv_mem.c #199 lv_mem_alloc())
Warn: Couldn't allocate memory 	(lv_mem.c #306 lv_mem_realloc())

@MyVanitar
Copy link
Author

These are the memory configurations in lv-conf.h

#define LV_DISP_ROT_MAX_BUF (10U * 1024U)
#define LV_MEM_SIZE (32U * 1024U)

@kisvegabor
Copy link
Member

The gif decoding needs a lot of memory to store temporary data from the previous frames. I've pushed fix to slightly lower but with 16 bit color depth it's still 4 x image_size bytes. With the example gif, it's 4 x 60 x 80 = 16,000 plus some extra memory used during decoding the gif.

Does it work if you increase LV_MEM_SIZE to 48U * 1024U?

@MyVanitar
Copy link
Author

MyVanitar commented Apr 26, 2021

Yes, it worked with 48U and I can see the animation. The speed of the animation is "a bit" slower than the actual test on a PC, however, the difference is not significant. The LCD bus is SPI which I flush the data using DMA. the main clock is 168MHz.

is there any method to inform the LVGL engine to use external SRAM? I can connect an external SRAM to the MCU using FSMC and I know the SRAM start address would be something like 0xC00000000 for example.

@kisvegabor
Copy link
Member

is there any method to inform the LVGL engine to use external SRAM? I can connected an external SRAM to the MCU using FSMC and I know the SRAM start address would be something like 0xC00000000 for example.

Yes, use LV_MEM_ADR in lv_conf.h.
From the 0xC000000 address, I suppose you use an ST MCU. For someone, it wasn't working well. See here. But I assume it's "only" a memory configuration issue.

@MyVanitar
Copy link
Author

Yes, use LV_MEM_ADR in lv_conf.h.
From the 0xC000000 address, I suppose you use an ST MCU. For someone, it wasn't working well. See here. But I assume it's "only" a memory configuration issue.

Yes, I use STM32. Thank you for your support.
By the way, this thread remains open till that freezing problem gets solved. The CodeBlock also freezes with that GIF file.

@kisvegabor
Copy link
Member

New comment here lecram/gifdec#13

@kisvegabor
Copy link
Member

@lecram has fixed the issue of the gif decoder and I updated our decoder accordingly.
Now the gif with the long-haired girl works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants