Ok, so I’ve come back to it a couple days later, and changing the ESP32 board library does indeed lead to a successful compilation, but it doesn’t actually function.
-
2.0.14 = Compiles and uploads. Result: backlight turns on but the UI isn’t drawn, there’s only a black screen. I have a white background with a single blue button for the UI in SLS.
-
2.0.17 = Same as above^.
-
3.0.0+ = See original error in my first post.
Small correction to my original post as well. These errors are actually produced using Arduino IDE 1.8.19, not v2. I’ve been switching between the two and got mixed up.
IDE 2.3.2 actually gives errors too, but seems to be related to the LVGL (or perhaps LovyanGFX) library.
Here is the error produced in IDE 2.3.2.
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:91:8: error: ‘lv_disp_draw_buf_t’ does not name a type; did you mean ‘lv_draw_buf_t’?
91 | static lv_disp_draw_buf_t draw_buf;
| ^~~~~~~~~~~~~~~~~~
| lv_draw_buf_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:6: error: variable or field ‘my_disp_flush’ declared void
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^~~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:20: error: ‘lv_disp_drv_t’ was not declared in this scope; did you mean ‘lv_fs_drv_t’?
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^~~~~~~~~~~~~
| lv_fs_drv_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:35: error: ‘disp’ was not declared in this scope
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:41: error: expected primary-expression before ‘const’
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t color_p)
| ^~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:75: error: expected primary-expression before '’ token
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:76: error: ‘color_p’ was not declared in this scope
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t color_p)
| ^~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:6: error: variable or field ‘my_touchpad_read’ declared void
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~~~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:23: error: ‘lv_indev_drv_t’ was not declared in this scope; did you mean ‘lv_indev_data_t’?
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~~~~~~~~~~~
| lv_indev_data_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:40: error: ‘indev_driver’ was not declared in this scope
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:70: error: expected primary-expression before '’ token
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:72: error: ‘data’ was not declared in this scope
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:72: note: suggested alternatives:
In file included from c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\unordered_map:48,
from c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\functional:61,
from C:\Users\Eugh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha3\cores\esp32/HardwareSerial.h:49,
from C:\Users\Eugh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha3\cores\esp32/Arduino.h:197,
from C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:3:
c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\bits\range_access.h:343:5: note: ‘std::data’
343 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
In file included from c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\bits\ranges_algobase.h:39,
from c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\bits\ranges_algo.h:35,
from c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\algorithm:63,
from C:\Users\Eugh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha3\cores\esp32/Arduino.h:185:
c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\bits\ranges_base.h:577:43: note: ‘std::ranges::__cust::data’
577 | inline constexpr __cust_access::_Data data{};
| ^~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:6: error: variable or field ‘my_disp_flush’ declared void
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^~~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:21: error: ‘lv_disp_drv_t’ was not declared in this scope; did you mean ‘lv_fs_drv_t’?
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^~~~~~~~~~~~~
| lv_fs_drv_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:36: error: ‘disp’ was not declared in this scope
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:42: error: expected primary-expression before ‘const’
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t color_p)
| ^~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:76: error: expected primary-expression before '’ token
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
| ^
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:109:77: error: ‘color_p’ was not declared in this scope
109 | void my_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t color_p)
| ^~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:6: error: variable or field ‘my_touchpad_read’ declared void
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~~~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:24: error: ‘lv_indev_drv_t’ was not declared in this scope; did you mean ‘lv_indev_data_t’?
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~~~~~~~~~~~
| lv_indev_data_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:41: error: ‘indev_driver’ was not declared in this scope
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:71: error: expected primary-expression before '’ token
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:73: error: ‘data’ was not declared in this scope
124 | void my_touchpad_read (lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
| ^~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:124:73: note: suggested alternatives:
c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\bits\range_access.h:343:5: note: ‘std::data’
343 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
c:\users\eugh\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32s3-elf-gcc\esp-12.2.0_20230208\xtensa-esp32s3-elf\include\c++\12.2.0\bits\ranges_base.h:577:43: note: ‘std::ranges::__cust::data’
577 | inline constexpr __cust_access::_Data data{};
| ^~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino: In function ‘void setup()’:
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:164:29: error: ‘draw_buf’ was not declared in this scope
164 | lv_disp_draw_buf_init( &draw_buf, buf, NULL, screenWidth * screenHeight / LVGL_BUFFER_RATIO );
| ^~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:164:5: error: ‘lv_disp_draw_buf_init’ was not declared in this scope; did you mean ‘lv_draw_buf_init’?
164 | lv_disp_draw_buf_init( &draw_buf, buf, NULL, screenWidth * screenHeight / LVGL_BUFFER_RATIO );
| ^~~~~~~~~~~~~~~~~~~~~
| lv_draw_buf_init
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:167:12: error: ‘lv_disp_drv_t’ does not name a type; did you mean ‘lv_fs_drv_t’?
167 | static lv_disp_drv_t disp_drv;
| ^~~~~~~~~~~~~
| lv_fs_drv_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:168:24: error: ‘disp_drv’ was not declared in this scope
168 | lv_disp_drv_init( &disp_drv );
| ^~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:168:5: error: ‘lv_disp_drv_init’ was not declared in this scope; did you mean ‘lv_fs_drv_init’?
168 | lv_disp_drv_init( &disp_drv );
| ^~~~~~~~~~~~~~~~
| lv_fs_drv_init
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:172:25: error: ‘my_disp_flush’ was not declared in this scope
172 | disp_drv.flush_cb = my_disp_flush;
| ^~~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:174:5: error: ‘lv_disp_drv_register’ was not declared in this scope; did you mean ‘lv_fs_drv_register’?
174 | lv_disp_drv_register( &disp_drv );
| ^~~~~~~~~~~~~~~~~~~~
| lv_fs_drv_register
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:177:12: error: ‘lv_indev_drv_t’ does not name a type; did you mean ‘lv_indev_data_t’?
177 | static lv_indev_drv_t indev_drv;
| ^~~~~~~~~~~~~~
| lv_indev_data_t
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:178:25: error: ‘indev_drv’ was not declared in this scope
178 | lv_indev_drv_init( &indev_drv );
| ^~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:178:5: error: ‘lv_indev_drv_init’ was not declared in this scope; did you mean ‘lv_fs_drv_init’?
178 | lv_indev_drv_init( &indev_drv );
| ^~~~~~~~~~~~~~~~~
| lv_fs_drv_init
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:180:25: error: ‘my_touchpad_read’ was not declared in this scope
180 | indev_drv.read_cb = my_touchpad_read;
| ^~~~~~~~~~~~~~~~
C:\Users\Eugh\Documents\export\SquareLine_Project2\ui\ui.ino:181:5: error: ‘lv_indev_drv_register’ was not declared in this scope; did you mean ‘lv_fs_drv_register’?
181 | lv_indev_drv_register( &indev_drv );
| ^~~~~~~~~~~~~~~~~~~~~
| lv_fs_drv_register
exit status 1
Compilation error: ‘lv_disp_draw_buf_t’ does not name a type; did you mean ‘lv_draw_buf_t’?
From here I manually updated the LovyanGFX library to 1.1.16. Now it successfully compiles under IDE 2.3.2 using ESP32 version 3.0.4. However, I then I got the same result as earlier with only a blank backlit screen upon upload.
I tried switching from QSPI PSRAM to OPI PSRAM as suggested in a forum post on Elecrow (as opposed to the QSPI PSRAM option recommended in the docs)… And voila! Success at long last! This QSPI/OPI issue was probably the result of the blank screen in IDE v1 too, but I didn’t test it.
I daresay proper devs will be banging your heads on your desks reading this post, I’ve no doubt done things the hard way or missed obvious things here and there, but in the end it’s working.
Hope this helps others who might face similar issues.
Edit: small update. Switched to a different project and forgot to update the LovyanGFX library. I received the same error as in my original post. So the LovyanGFX version included with SLS obviously needs updating