Using another version of lvgl in an existing project

Hello,

I’ve hesitated to post this is the “getting started” section of the forum, since I technically have never installed lvgl myself, but I’m working on a project that already has it implemented.

I’ve been hired a few months ago to replace someone working on a project that uses lvgl. I’ve rarely been touching lvgl itself until now - it just was there, and I just had to replicate work that already existed, and mostly work on other backend tasks. The developper I replaced left little to no info on what she did as far as this library library goes, IE how it was installed or if she made any changes to it, etc. It was never really her specialization either, and she was doing that while planning to leave for another job - so it’s quite possible she did some things incorrectly.

The device itself is a small device with a variscite micro controller, running a very light version of debian, without X. It has a small screen, and lvgl writes on its framebuffer.

I was asked, lately, to add a feature that requires me to load png files dynamically and display them on the framebuffer.

This is where my problems begin: so far I had been making pictures by converting them to C arrays and compiling the project with them.
But as I need to implement this new feature, I found that I should be using decoders - indeed I am now downloading files, from the device, so compiling with new pictures is not an option. Attempting that, I discovered that I am lacking a LOT of lvgl code in my lvgl directory - which seems to hint that she had a choice what to install or not. Specifically what is relative to decoders seems to be missing.

I have tried to simply re download the latest version of lvgl and just replace the existing directory but nothing seems to be the same, really - a lot of files changed, the hierarchy changed, things moved to other folders - I have tried to use the new library, moving files around, adding things into them, moving includes, changing the paths where they’re looked for, and so on - but eventually I always run into a much deeper problem that I can’t fix, all this because I need source code relative to decoders - which I can’t seem to simply be able to add in my lvgl directories.

I have no real idea what to do from now on - as a temporary solution I’m sending frames to the framebuffer using fbida, but that’s completely disgusting.

Let’s say I would want to implement a completely different version of lvgl in my pre existing projects, how would I have to do it?

Here is information that I believe may be pertinent, I can get more if asked to:

LVGL_VERSION_MAJOR 5
LVGL_VERSION_MINOR 3

lvgl directory tree in my project:

image

If I wanted to use a new installation of lvgl, with the features I require, how would I do it? Do I need to do so?

First off, thanks for the detailed write-up! It really helps me understand the situation.

From what I can tell, you basically have two options: either keep using 5.3, or upgrade to 6.1 (which will probably be more work as a substantial number of APIs changed). Given the facts that you’ve had little experience working with LittlevGL (pardon the repetition) and that you’re working on an existing project, I suggest you just stick with what you have for now.

The lvgl directory structure looks complete to me, although it is possible the previous developer removed some files. If you want to redownload a fresh copy of version 5.3 you can get the latest patch release here.

Have you seen this article? It describes how to get a PNG decoder working with LittlevGL. That link has been updated for 6.x (and has some more information AFAIK) but you can find the 5.x version here. Perhaps that will help you with getting the decoder working.

Alright, thank you. I’m working on other stuff right now, I’ll get back to this in a moment. Yes I’ve seen this page, decoder source files seem to be missing in my installation. I will re install lvgl v5.3 later and update this thread.

Simply replacing the folders with the right version proved much easier than trying to upgrade. A few things were needed but I compiled almost immediately. I’m using the decoder now. Thanks!

1 Like