radiosound-com / makerfabs-parallel-tft-lvgl-lgfx

LVGL demos using LovyanGFX driver on Makerfabs 16-bit parallel TFT (ESP32-S2 or ESP32-S3)
Other
29 stars 10 forks source link

build fails #2

Open ammaree opened 1 year ago

ammaree commented 1 year ago

I am trying to build using latest version of ESP-IDF Master ie v5.0 I am building from the command line, not using an IDE, on latest MacOS Ventura 13.0.1.

Getting the following error messages.

/Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:80:15: error: 'lv_demo_music' was not declared in this scope 80 | {"Music", lv_demo_music}, | ^~~~~ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:81:17: error: 'lv_demo_widgets' was not declared in this scope 81 | {"Widgets", lv_demo_widgets}, | ^~~~~~~ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:82:17: error: 'lv_demo_keypad_encoder' was not declared in this scope 82 | {"Encoder", lv_demo_keypad_encoder}, | ^~~~~~ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:83:19: error: 'lv_demo_benchmark' was not declared in this scope 83 | {"Benchmark", lv_demo_benchmark}, | ^~~~~ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:84:16: error: 'lv_demo_stress' was not declared in this scope; did you mean 'lv_mem_test'? 84 | {"Stress", lv_demo_stress} | ^~~~~~ | lv_mem_test /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp: In function 'void init_lvgl_lgfx()': /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:160:31: warning: missing initializer for member 'esp_timer_create_args_t::arg' [-Wmissing-field-initializers] 160 | .name = "periodic_gui"}; | ^ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:160:31: warning: missing initializer for member 'esp_timer_create_args_t::dispatch_method' [-Wmissing-field-initializers] /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:160:31: warning: missing initializer for member 'esp_timer_create_args_t::skip_unhandled_events' [-Wmissing-field-initializers] /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp: At global scope: /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/main/main.cpp:90:13: warning: 'disable_flush' defined but not used [-Wunused-variable] 90 | static bool disable_flush = false; | ^~~~~ [916/1181] Building CXX object esp-idf/LovyanGFX/CMakeFiles/__idf_LovyanGFX.dir/src/lgfx/v1/LGFXBase.cpp.objninja: build stopped: subcommand failed.

The warnings at the end I should be able to get rid of easily. The errors looks like the demo modules are not included. I have not go into the LVGL config at all, from previous experience with V7.x it felt like untangling spaghetti.

Any suggestions?

André

ammaree commented 1 year ago

OK, got beyond those by enabling the demos and a number of additional fonts using menuconfig.

Also fixed (I think) a memory error asking for an increase in memory, changed to 40.

error Insufficient memory for lv_demo_widgets. Please set LV_MEM_SIZE to at least 38KB (38ul * 1024ul). 48KB is recommended.

Next errors:

[767/1140] Building C object esp-idf/lvgl/CMakeFiles/__idf_lvgl.dir/demos/benchmark/lv_demo_benchmark.c.obj/Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/lvgl/demos/benchmark/lv_demo_benchmark.c: In function 'arc_create': /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/lvgl/demos/benchmark/lv_demo_benchmark.c:974:33: warning: cast between incompatible function types from 'void ()(lv_obj_t , uint16_t)' {aka 'void ()(struct _lv_obj_t , short unsigned int)'} to 'void ()(void , int32_t)' {aka 'void ()(void , long int)'} [-Wcast-function-type] 974 | lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t) lv_arc_set_end_angle); | ^ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/lvgl/demos/benchmark/lv_demo_benchmark.c: In function 'fall_anim': /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/lvgl/demos/benchmark/lv_demo_benchmark.c:995:29: warning: cast between incompatible function types from 'void ()(struct _lv_obj_t , lv_coord_t)' {aka 'void ()(struct _lv_obj_t , short int)'} to 'void ()(void , int32_t)' {aka 'void ()(void , long int)'} [-Wcast-function-type] 995 | lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t) lv_obj_set_y); | ^ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp: In member function 'virtual bool lgfx::v1::Bus_SPI::init()': /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/LovyanGFX/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp:126:17: error: 'spi_bus_get_attr' was not declared in this scope 126 | auto attr = spi_bus_get_attr(_cfg.spi_host); | ^~~~ /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'void lgfx::v1::i2c::i2c_stop(int)': /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp:621:7: error: 'ets_delay_us' was not declared in this scope; did you mean 'esp_rom_delay_us'? 621 | ets_delay_us(I2C_CLR_BUS_HALF_PERIOD_US); | ^~~~ | esp_rom_delay_us /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::readBytes(int, uint8_t*, size_t)': /Users/andremaree/Dropbox/devs/ws/z-projects/makerfabs-parallel-tft-lvgl-lgfx/components/LovyanGFX/src/lgfx/v1/platforms/esp32/common.cpp:1134:13: error: 'ets_delay_us' was not declared in this scope; did you mean 'esp_rom_delay_us'? 1134 | ets_delay_us(us_limit >> 1); /// このウェイトを外すと受信失敗するケースがある; | ^~~~ | esp_rom_delay_us

Are these errors related to IDF v5?

ftab commented 1 year ago

That's odd. I'd have expected it to pick up the sdkconfig defaults, which includes the demos. Check the other LV_* config options starting from here, and make sure yours matches: https://github.com/radiosound-com/makerfabs-parallel-tft-lvgl-lgfx/blob/master/sdkconfig.defaults.esp32s3#L1444

Other than that, yes, that's a v5 deprecation. As v5 is still a moving target and I haven't seen any roadmap for if/when it will be released, I'd recommend sticking with 4.4 for now.

If you need >4.4 for other reasons but don't necessarily need the latest master, you might try the version of idf master I was on at the time I created this project, e899edd. That was about where I was when I thought to start fixing some of the build errors in LGFX. But I haven't been able to keep my "hobby" projects like this one up with the pace of changes since then. I am in the middle of hacking up ESP-ADF and a work project to build in the latest release/v5.0 branch, and it is a significant amount of work. (Latest master even failed to boot for me)

If you need to be on bleeding edge master, I don't know how much work it will be to bring LVGL and LGFX up to date with the deprecations and the stricter compiler. If you're lucky, just change ets_delay_us to esp_rom_delay_us and that's it. If you're unlucky, you'll dive down a rabbit hole of other deprecations, printf specifiers not matching the types, and other things like that.