How to create "complex" project structures in esp-idf?

Hello people,

I started doing the tests step by step.
I took the example “hello_world” and went removing files one by one and checking if it compiled, until the minimum necessary to compile only using CMake.

After this step, i added the components folder to “hello_world” project and follow the tips of this discussion and the espressif discussion.
After a lot of “trial and error” i made the project compile.

The next step is to change lib littlevgl (i want to make it as clean as possible) to compile using cmake only.
I will try to change all includes, in all files, and try to make the path as short as possible.

In annex follow the two projects with the minimum requirements to compile on cmake.

After i compile the project with the littlevgl component, if anyone wants to upload it to littevgl git, they feel free to.
I will post the code here, when i finish.

hello_world-withComponents.zip (4.8 KB)
hello_world-Cmake project minimum.zip (1.9 KB)

Thank’s.

Awesome! I’ve almost started to play with that but good to see that you’ve already made great progress. It’d be great the update project on GitHub.

Waiting for the updates. :slight_smile:

Hello people,

I am try to create a folder inside components folder ie:
projectFolder/components/ui/.global_conf

Yes “projectFolder/components/ui” are working, only check on this project i posted above.
hello_world-withComponents.zip

In folder “.global_conf” i put all *.h files that i consider LittleVgl config and other things like:

“.global_conf” folder

  • lv_conf.h
  • lv_conf_checker.h
  • lv_conf_template.h
  • lv_ex_conf.h
  • lv_ex_conf_templ.h
  • lv_examples.h
  • lv_test.h
  • lv_version.h
  • lvgl.h

My problem are how to register these folder(that only has *.h files) on Cmake espressif structuring.

I already trying to add this folder like a component folder(so i could use requires on the others components that needed the files in this folder) but not works.
I tried other things too, but no luck.

I’m following a part of the techtoys project structure.

Any suggestion ???

Below follows the project:
esp32_ili9341-master.zip (537.8 KB)

Thank’s.

Hi kisvegabor,

I was able to make( CMake :slight_smile: ) the project compile.

In annex follow the project with the minimum Cmake requirements i think.

You need to check the project flags in component.mk files that no longer exist more.

I added a folder in project root named “.Project-Files” as a suggestion to put “.git” folder, assembly images, readme and so on.

I changed all include in all files, too.
Now the includes are all “simple” like #include “lvgl.h”

I have a doubt:
I need to register the .bin files ?
I need to register the .jpg and .png files ? I dont know if some of these files are invoked from some .c files.
Example:
idf_component_register( SRCS
“blue_flower_8.bin”
“blue_flower_16.bin”
)

esp32_ili9341-master.zip (2.4 MB)

Thank’s.

Great news!

I was planning to make it possible to switch between lvgl/lvgl.h and lvgl.h. Good to know that it’s required for the ESP project too.

As they are not complied just read as files run time I suppose it’s not required to add them.

Could you send a Pull request?

Hi Kisvegabor,

I never worked with github. I think i requested a pull request on the git link:
https://github.com/littlevgl/esp32_ili9341

Thank’s.

There is no pull request open on that repository. It looks like it didn’t work.

Hi,

I will try tomorrow.

Hi,

I have a question about the example program
https://github.com/littlevgl/esp32_ili9341

I flash the code on hardware, first without touch, ie, only display. Everything is OK. The page scrolls between write, list and chart.

After i added the touch screen. The page still scrolls, and the touch respond in a bad way.

What can it be ?
Any suggestions?
Do I need to configure anything ?
Is that because of the “component.mk” files i delete, because they had some configuration flags.

Thank’s.

Hi,

Disable “slide show mode” here: https://github.com/littlevgl/lv_examples/blob/master/lv_ex_conf_templ.h#L45

Don’t need to calibrate the touch sensor with the XPT2046 controller ?

It seems that the lib is interpreting the location of touch in another position.

I disable “slide show mode”.

I will try another equal display to make sure the problem is not the hardware.

Hi Kisvegabor,

My project estructuring is “very different” from the original.

Does the pull request apply ?

Thank’s.

Hi again :),

I had forgotten to set up this part:

#define XPT2046_X_MIN 0
#define XPT2046_Y_MIN 0
#define XPT2046_X_MAX 4095
#define XPT2046_Y_MAX 4095

Now it’s working but i still think i need to calibrate the touch, because it’s clicking a little out of place and the touch is a little sensitive.

Any suggestion ?

Thank’s.

My project estructuring is “very different” from the original.

I see. This way it’s more difficult to see that changes and I need some time to update the project. Can send the GitHub link of your project? Seeing the commit would be useful.

Now it’s working but i still think i need to calibrate the touch, because it’s clicking a little out of place and the touch is a little sensitive.

  1. Set 0 and 4095 as you did now and
  2. Run the tp_cal app
  3. Update the values of XPT2046_X/Y_MIN/MAX accordingly

https://forum.lvgl.io/t/issue-with-calibration-of-display-ili9341-display-and-xpt-2046-touch-controller

check this thread for your issue. we all had the same issue but a delay fixed it I guess

Where do you put your delay ?
How do you implement this delay ?
Using freeRtos ?

before /Normalize Data/
add somedelay like 20ms is enough I guess

Baldhead, thanks for sharing the files, you did tons of work changing them. I am having the same CMAKE issue transiting to LVGL 6.0 with esp.idf v4.1 and I came up with the same conclusion but when I saw how many lines I need to change I just gave up.

now that you’ve seen how to do it basically will be manual work

Just to clarify something previously discussed.
Projects made using latest esp-idf (v.4.x) can be compiled with CMake and Make files depending on the tools you use. Previous versions did not have CMake and future versions will not have Make, we are in the middle of transition period now :slight_smile: