Hi, I am a beginner with arduino and with programming boards, I have bought an esp32 and have been following a tutorial linked to the board on the waveshare page ( both linked at the bottom ). In this tutorial, there is a 8 demos, all of the demos work on my esp32 other than the LVGL ones, they get an error as they are looking for a file within the wrong directory. No matter what i try, i cannot get anything to display on my esp32 screen, nor can I flash it. If anyone would help me display something on my screen that would be greatly appreciated.
I'll provide instructions you can follow to do that:
This procedure is not intended to solve the problem. The purpose is to gather more information.
Open the problematic demo in Arduino IDE.
Select Sketch > Verify/Compile from the Arduino IDE menus.
Wait for the compilation to fail.
You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
Open a reply here on this forum topic by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the compilation output into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
Click the "Reply" button to publish the post.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.
Select the .txt file you saved from the "Open" dialog.
Click the "Open" button.
The dialog will close.
Click the "Reply" button to publish the post.
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.
type or paste codeIn file included from c:/Users/User/Documents/Arduino/libraries/lvgl/src/lv_init.h:16,
from c:/Users/User/Documents/Arduino/libraries/lvgl/lvgl.h:21,
from c:\Users\User\Documents\Arduino\libraries\lvgl\src/lvgl.h:16,
from C:\Users\User\Documents\Arduino\examples\08_LVGL_V9_Test\lvgl_port.c:4:
c:/Users/User/Documents/Arduino/libraries/lvgl/src/lv_conf_internal.h:60:18: fatal error: ../../lv_conf.h: No such file or directory
60 | #include "../../lv_conf.h" /* Else assume lv_conf.h is next to the lvgl folder. */
| ^~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1 here
Thanks again for the reply, I have reinstalled Arduino IDE so I can follow your instructions better, I have installed: ESP32 3.2.1 by espressif systems, in boards manager, then lvgl 9.3.0 in library manager. Then under Tools, I have selected the correct COM slot, and ESP32S3 Dev Module under board, then enabled USB CDC on boot. Then I downloaded, extracted, and moved everything under 'Arduino' ( from the demo ) into my existing 'Arduino' folder, this includes libraries, examples, and therefore the lv_conf.h file under lvgl9. Next I moved the file: 'lvgl9/lv_conf.h' into the directory you suggested. Then I ran the example under Arduino/08_LVGL_V9_Test/08_LVGL_V9_Test.ino ( which was imported from the provided demo folder which I linked in the original post.) which has solved the original error, but in turn provided a new error: `C:\Users\bubbl\Documents\Arduino\examples\08_LVGL_V9_Test\lvgl_port.c:13:10: fatal error: demos/lv_demos.h: No such file or directory
13 | #include "demos/lv_demos.h"
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: demos/lv_demos.h: No such file or directory`
EDIT: Im not sure why the original error message didn't send in a code block, here it is again, also, I believe the file it is reffering to is located in:
C:\Users\User\Downloads\ESP32-S3-LCD-3.16-Demo\ESP32-S3-LCD-3.16-Demo\Arduino\libraries\lvgl9\lvgl\demos.
:\Users\User\Documents\Arduino\examples\08_LVGL_V9_Test\lvgl_port.c:13:10: fatal error: demos/lv_demos.h: No such file or directory
13 | #include "demos/lv_demos.h"
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: demos/lv_demos.h: No such file or directory
If you installed it from library manager instead of using the downloaded lvgl9/lvgl, you need to set up the demos folder.
Follow the instructions at "Use the examples and demos" section in the reference page posted in post #4.
important:
Due to some the limitations of Arduino's build system you need to copy lvgl/examples to lvgl/src/examples. Similarly for the demos lvgl/demos to lvgl/src/demos.
Sorry, i don't fully understand what you're saying, I have read the referenced instructions, I am using a demo which has a .ino file so I don't think I should need to load using the 'lv_example' function? Anyway, I have copied the demos and example folder into the directory you suggested, I wasn't sure if this was in the Arduino/Libraries or Arduino/Examples directory, so I did both. However I am still getting the same error, in the directory: C:\Users\User\Documents\Arduino\libraries\lvgl9\lvgl\src, my folder now looks like this:
I see now, i have copied 'demos' into the correct directory now, this has solved the error, now I am presented with a new error:
In file included from c:\Users\bubbl\Documents\Arduino\libraries\lvgl\src/demos/lv_demos.h:35,
from C:\Users\bubbl\Documents\Arduino\examples\08_LVGL_V9_Test\lvgl_port.c:13:
c:\Users\bubbl\Documents\Arduino\libraries\lvgl\src/demos/widgets/lv_demo_widgets.h:17:10: fatal error: ../../src/draw/lv_draw.h: No such file or directory
17 | #include "../../src/draw/lv_draw.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1
the file 'lv_draw.h' is located in: C:\Users\User\Documents\Arduino\libraries\lvgl\src\draw
Thank you again, this has solved that error, however once again a new error has occured:
C:\Users\User\Documents\Arduino\examples\08_LVGL_V9_Test\src\demos\benchmark\assets\img_benchmark_cogwheel_alpha16.c:1:10: fatal error: ../../../lvgl.h: No such file or directory
1 | #include "../../../lvgl.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: ../../../lvgl.h: No such file or directory```
Unfortunately, I can't find img_benchmark_cogwheel_alpha16.c under the Arduino\examples\08_LVGL_V9_Test\src\demos\benchmark\assets\ which downloaded from Waveshare.
Anyway, #include "../../../lvgl.h" should be #include "lvgl.h" if img_benchmark_cogwheel_alpha16.c is not located in the lvgl library folder.
That's strange, I cannot find a file named 'img_benchmark_cogwheel_alpha16.c'in that directory either, this may be a silly question, but where should i change '#include "../../../lvgl.h' to '#include "lvgl.h"'?
EDIT: I searched for the file, and it is found in 3 instances, all of them under lvgl8, the demo I am running is using lvgl9, so I'm not sure why i'm getting this error?
I thought that, however there isn't a file with that name in that directory?, however there is files with the same name under lvgl8 in multiple locations, which of them should I edit?
They are found in these directories:
C:\Users\User\Documents\Arduino\libraries\lvgl8\lvgl\src\demos\benchmark\assets
C:\Users\User\Documents\Arduino\libraries\lvgl8\lvgl\demos\benchmark\assets
C:\Users\User\Documents\Arduino\examples\08_LVGL_V9_Test\src\demos\benchmark\assets
I have changed the file in all of those locations, however I am still getting the error, it looks like the file is made when the program runs? I am going to look at the directory in file explorer and verify the program to see what happens.
EDIT: The file name nkeeps changing, but with the same error, I am going to keep replacing the directory it is looking at with the one you said, I will reply when I get stuck on an error.
Okay, thanks for this, it appears there is many more files with the wrong referenced directory inside, I am changing them all over to #include "lvgl.h" rather than #include "../../../lvgl.h"