arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.7k stars 4.72k forks source link

Bugfix: crash when using tjpegd and LVGL #21544

Closed Staars closed 1 month ago

Staars commented 1 month ago

Description:

Tasmotas Arduino framework does include tjpegd in ROM and it clashes with the externally added library. The external library would be compiled in with LVGL activated in the build environment and lead to repeatable crashes when accessing functions of tjpegd in other code parts. This will also shrink the firmware binary in these cases.

Checklist:

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

s-hadinger commented 1 month ago

Thanks. We need to keep track of this change otherwise it will be overwritten by the next LVGL update. Do you think of any other option in librariy.json to achieve the same result without changing source code ?

Staars commented 1 month ago

Maybe … I am not sure, if there is guaranteed flag in the Arduino framework.

ESP_ROM_HAS_JPEG_DECODE Could be a candidate.

if this works, the best way would be to use this instead and upstream the change to LVGL.

s-hadinger commented 1 month ago

I was thinking about adding in library.json of LVGL:

[...]
    "build": {
        "includeDir": ".",
        "flags": [ "-I$PROJECT_DIR/tasmota/lvgl_berry" ],
                 "srcFilter": ["-<libs/tjpgd/**>"]
    },
[...]

I haven't tested at all, but that was the spirit of removing a directory from the build chain.

Jason2866 commented 1 month ago

Yep, suggested solution should work fine. https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_src_filter.html#projectconf-build-src-filter