Closed Massimiliano-solutiontech closed 5 months ago
I also did a color test
Hi! I have a suspicion what's causing this, but I need your help to verify that. You said that it works with the LVGL project, right? For that project where it works, what does your sdkconfig
contain a line with CONFIG_LV_COLOR_16_SWAP
? If yes, could you paste it here?
Hi @tronical thanks for the response I checked for CONFIG_LV_COLOR_16_SWAP
in the LVGL
project but isn't set
Thanks, this confirms what I thought. Could you try the following?
Change your idf_component.yml
to fetch Slint from git:
slint:
git: https://github.com/slint-ui/slint
path: api/cpp/esp-idf/slint
version: simon/esp-idf-color-swap
Call the slint_esp_init
like so:
slint_esp_init(SlintPlatformConfiguration {
.size = slint::PhysicalSize({ EXAMPLE_LCD_H_RES, EXAMPLE_LCD_V_RES }),
.panel = panel_handle,
.touch = tp,
.buffer1 = buffer,
.color_swap_16 = false });
That's what I'm getting in the terminal when I try to compile:
idf_component.yml
## IDF Component Manager Manifest File
dependencies:
espressif/esp_lcd_ra8875: "==1.0.0"
espressif/esp_lcd_touch_gt911: "==1.1.0"
# slint/slint: "==1.6.0"
slint:
git: https://github.com/slint-ui/slint
path: api/cpp/esp-idf/slint
version: simon/esp-idf-color-swap
## Required IDF version
idf:
version: ">=4.1.0"
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
terminal output
* Executing task: cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B /Users/massimilianomontagni/Progetti/Playgrounds/esp/slint-hello-world/build -S /Users/massimilianomontagni/Progetti/Playgrounds/esp/slint-hello-world -DCCACHE_ENABLE=1
-- Found Git: /usr/bin/git (found version "2.39.3 (Apple Git-146)")
-- ccache will be used for faster recompilation
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/massimilianomontagni/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/massimilianomontagni/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/massimilianomontagni/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32s3-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
Manifest files have changed, solving dependencies.
......CMake Error at /Users/massimilianomontagni/esp/v5.2/esp-idf/tools/cmake/build.cmake:544 (message):
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/prepare_components/__main__.py", line 6, in <module>
main()
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/prepare_components/prepare.py", line 132, in main
args.func(args)
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/prepare_components/prepare.py", line 31, in prepare_dep_dirs
).prepare_dep_dirs(
^^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/core.py", line 111, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/core.py", line 746, in prepare_dep_dirs
downloaded_components = download_project_dependencies(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/dependencies.py", line 271, in download_project_dependencies
solution = solver.solve()
^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/version_solver/version_solver.py", line 91, in solve
self.solve_manifest(manifest)
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/version_solver/version_solver.py", line 141, in solve_manifest
self.solve_component(dep, manifest_path=manifest.path)
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/version_solver/version_solver.py", line 161, in solve_component
cmp_with_versions, source = self.get_versions_from_sources(requirement)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_manager/version_solver/version_solver.py", line 118, in get_versions_from_sources
cmp_with_versions = source.versions(
^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_tools/sources/git.py", line 197, in versions
component_hash = hash_dir(source_path, include=include, exclude=exclude)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_tools/hash_tools/calculate.py", line 61, in hash_dir
sha.update(hash_file(file_path).encode('utf-8'))
^^^^^^^^^^^^^^^^^^^^
File "/Users/massimilianomontagni/.espressif/python_env/idf5.2_py3.11_env/lib/python3.11/site-packages/idf_component_tools/hash_tools/calculate.py", line 30, in hash_file
with open(Path(file_path).as_posix(), 'rb') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory:
'/var/folders/w_/b1bc_2c96bz9dd2lck5p_jk40000gn/T/tmpxq8oos6h/api/cpp/esp-idf/slint/LICENSE'
Call Stack (most recent call first):
/Users/massimilianomontagni/esp/v5.2/esp-idf/tools/cmake/project.cmake:605 (idf_build_process)
CMakeLists.txt:10 (project)
-- Configuring incomplete, errors occurred!
* The terminal process "/bin/zsh '-l', '-c', 'cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B /Users/massimilianomontagni/Progetti/Playgrounds/esp/slint-hello-world/build -S /Users/massimilianomontagni/Progetti/Playgrounds/esp/slint-hello-world -DCCACHE_ENABLE=1'" terminated with exit code: 1.
Ah weird, I can reproduce that. This used to work, not sure what changed. But here's a workaround:
git clone -b simon/simon/esp-idf-color-swap https://github.com/slint-ui/slint
idf_component.yml
like so: slint:
path: /path/to/where/your/clone/is/slint/api/cpp/esp-idf/slint
Yep I confirm that it works! Thanks for the support. Do you have an ETA for when this fix will be available in a release?
I'd say likely in the next release in 4-5 weeks.
I'm a bit torn though, whether this should be an API like this (run-time) or if it would perhaps be better if it were a Kconfig option. This isn't typically a dynamic setting. Except if we ever want to go multi-display then a run-time API makes more sense.
Thank you so much for the support
Regarding the pixelation of the SVG / AboutSlint: This is caused by the view box of the SVG being rather small. If you're using SVGs with the software renderer and embedding images as textures at compile time, then you're right now funrtunately required to tweak the view box of the .svg file to match the resolution you'd like to see (that looks sharp).
I'm experiencing issues with rendering quality and colors on the ESP32-S3-Touch-LCD-4.3
esp_lcd_panel_invert_color
but it wasn't the issue)I would like to point out that I'm a newbie with
Slint
so it might be my faultDependency versions
slint-hello-world.cpp
```cpp #includeappwindow.slint
```slint import { VerticalBox, AboutSlint } from "std-widgets.slint"; export component AppWindow { VerticalBox { AboutSlint {} Text { text: "Hello World"; font-size: 18px; horizontal-alignment: center; } } } ```idf_component.yml
```yml ## IDF Component Manager Manifest File dependencies: espressif/esp_lcd_ra8875: "==1.0.0" espressif/esp_lcd_touch_gt911: "==1.1.0" slint/slint: "==1.6.0" ## Required IDF version idf: version: ">=4.1.0" # # Put list of dependencies here # # For components maintained by Espressif: # component: "~1.0.0" # # For 3rd party components: # username/component: ">=1.0.0,<2.0.0" # username2/component2: # version: "~1.0.0" # # For transient dependencies `public` flag can be set. # # `public` flag doesn't have an effect dependencies of the `main` component. # # All dependencies of `main` are public by default. # public: true ```