I am using lv_micropython to create an application. I have the latest commit and the firmware build fails.
$ git clone https://github.com/lvgl/lv_micropython.git
Commits on Mar 14, 2023 43ac0377a740559086a6d9aa550b1bf0bfa6e3d6
$ cd lv_micropython
$ git submodule update --init --recursive lib/lv_bindings
$ vim lib/lv_bindings/lv_conf.h
$ grep -i color_depth lib/lv_bindings/lv_conf.h
#ifndef LV_COLOR_DEPTH
#define LV_COLOR_DEPTH 16
$ make -C ports/rp2 BOARD=PICO submodules
$ make -C mpy-cross V=1
OK
$ make -C ports/rp2 BOARD=PICO USER_C_MODULES=../../lib/lv_bindings/bindings.cmake V=1
MPY _boot_fat.py
MPY rp2.py
MPY _boot.py
MPY ds18x20.py
MPY onewire.py
MPY dht.py
MPY uasyncio/__init__.py
MPY uasyncio/core.py
MPY uasyncio/event.py
MPY uasyncio/funcs.py
MPY uasyncio/lock.py
MPY uasyncio/stream.py
MPY neopixel.py
GEN /home/masahiro/lv_micropython/ports/rp2/build-PICO/frozen_content.c
[ 4%] Generating genhdr/moduledefs.split
[ 4%] Generating genhdr/moduledefs.collected
Module registrations updated
[ 4%] Generating genhdr/moduledefs.h
Scanning dependencies of target firmware
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
[ 4%] Building C object CMakeFiles/firmware.dir/home/masahiro/lv_micropython/py/argcheck.c.obj
In file included from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/lv_img_buf.h:17,
from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/lv_img_decoder.h:19,
from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/lv_img_cache.h:16,
from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_gc.h:22,
from /home/masahiro/lv_micropython/ports/rp2/mpconfigport.h:190,
from /home/masahiro/lv_micropython/py/mpconfig.h:62,
from /home/masahiro/lv_micropython/py/mpstate.h:31,
from /home/masahiro/lv_micropython/py/runtime.h:29,
from /home/masahiro/lv_micropython/py/argcheck.c:30:
/home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/../misc/lv_color.h: In function 'lv_color_mix':
/home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/../misc/lv_color.h:589:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
589 | uint16_t c1_16 = *(uint16_t *)&c1;
| ^~~~~~~~~~~~~~~
/home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/../misc/lv_color.h:590:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
590 | uint16_t c2_16 = *(uint16_t *)&c2;
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [CMakeFiles/firmware.dir/build.make:699: CMakeFiles/firmware.dir/home/masahiro/lv_micropython/py/argcheck.c.obj] γ¨γ©γΌ 1
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[2]: *** [CMakeFiles/Makefile2:1329: CMakeFiles/firmware.dir/all] γ¨γ©γΌ 2
make[2]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[1]: *** [Makefile:91: all] γ¨γ©γΌ 2
make[1]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make: *** [Makefile:27: all] γ¨γ©γΌ 2
make: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2' γγεΊγΎγ
Should I wait a little longer?
what version of LVGL are you running?
I also want to make sure you are using the correct build commands.
This is the order in which things need to be done.
git clone https://github.com/lvgl/lv_micropython.git
cd lv_micropython
git submodule update --init --recursive lib/lv_bindings
make -C ports/rp2 submodules
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential
make -C mpy-cross
cd ports/rp2
make BOARD=PICO USER_C_MODULES="../../lib/lv_bindings/bindings.cmake"
I believe that enclosing the USER_C_MODULES in double quotes. might have an effect on it. It did for the last user that had compilation issues when compiling for the RP2
1 Like
What is the version of LVGL?
lv_micropython is the latest version of the LVGL master branch as it is cheked out in submodules.
I have been able to build with and without " UESR_C_MODULES= on mine.
Incidentally, I can BUILD with COLOR_DEPTH=32 without any problem, but with COLOR_DEPTH=16 I have some problems.
$ make -C ports/rp2 BOARD=PICO USER_C_MODULES="../../lib/lv_bindings/bindings.cmake" V=1
make: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2' γ«ε
₯γγΎγ
[ -e build-PICO/CMakeCache.txt ] || cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO -DUSER_C_MODULES=../../lib/lv_bindings/bindings.cmake
make -s -C build-PICO
make[1]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
make[2]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
[ 0%] Built target bs2_default
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
[ 1%] Built target bs2_default_padded_checksummed_asm
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
[ 1%] Performing build step for 'ELF2UF2Build'
make[4]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO/elf2uf2' γ«ε
₯γγΎγ
make[5]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO/elf2uf2' γ«ε
₯γγΎγ
make[6]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO/elf2uf2' γ«ε
₯γγΎγ
Consolidate compiler generated dependencies of target elf2uf2
make[6]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO/elf2uf2' γγεΊγΎγ
[100%] Built target elf2uf2
make[5]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO/elf2uf2' γγεΊγΎγ
make[4]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO/elf2uf2' γγεΊγΎγ
[ 1%] No install step for 'ELF2UF2Build'
[ 1%] Completed 'ELF2UF2Build'
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
[ 2%] Built target ELF2UF2Build
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
[ 2%] Generating genhdr/mpversion.h
[ 2%] Generating frozen_content.c
Consolidate compiler generated dependencies of target firmware
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γ«ε
₯γγΎγ
[ 2%] Generating genhdr/mpversion.h
[ 2%] Building C object CMakeFiles/firmware.dir/home/masahiro/lv_micropython/py/argcheck.c.obj
In file included from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/lv_img_buf.h:17,
from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/lv_img_decoder.h:19,
from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/lv_img_cache.h:16,
from /home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_gc.h:22,
from /home/masahiro/lv_micropython/ports/rp2/mpconfigport.h:190,
from /home/masahiro/lv_micropython/py/mpconfig.h:62,
from /home/masahiro/lv_micropython/py/mpstate.h:31,
from /home/masahiro/lv_micropython/py/runtime.h:29,
from /home/masahiro/lv_micropython/py/argcheck.c:30:
/home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/../misc/lv_color.h: In function 'lv_color_mix':
/home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/../misc/lv_color.h:589:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
589 | uint16_t c1_16 = *(uint16_t *)&c1;
| ^~~~~~~~~~~~~~~
/home/masahiro/lv_micropython/lib/lv_bindings/lvgl/src/misc/../draw/../misc/lv_color.h:590:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
590 | uint16_t c2_16 = *(uint16_t *)&c2;
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [CMakeFiles/firmware.dir/build.make:699: CMakeFiles/firmware.dir/home/masahiro/lv_micropython/py/argcheck.c.obj] γ¨γ©γΌ 1
make[3]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[2]: *** [CMakeFiles/Makefile2:1329: CMakeFiles/firmware.dir/all] γ¨γ©γΌ 2
make[2]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make[1]: *** [Makefile:91: all] γ¨γ©γΌ 2
make[1]: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2/build-PICO' γγεΊγΎγ
make: *** [Makefile:27: all] γ¨γ©γΌ 2
make: γγ£γ¬γ―γγͺ '/home/masahiro/lv_micropython/ports/rp2' γγεΊγΎγ
masahiro@U2204LTS:~/lv_micropython$
This is related to this GitHub issue. I suggest continuing this discussion there:
opened 09:48PM - 03 Mar 23 UTC
### Describe the bug
ESP32 reports `dereferencing type-punned pointer will br⦠eak strict-aliasing rules` on `lv_color.h`:
```
[11/18] Building C object esp-idf/lvgl/CMakeFiles/__idf_lvgl.dir/src/misc/lv_color.c.obj
In file included from /home/amirgon/projects/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_color.c:9:
/home/amirgon/projects/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_color.h: In function 'lv_color_mix':
/home/amirgon/projects/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_color.h:590:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
uint32_t bg = (uint32_t)((uint32_t)(*(uint16_t *)&c2) | ((uint32_t)(*(uint16_t *)&c2) << 16)) &
^~~~~~~~~~~~~~~
/home/amirgon/projects/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_color.h:590:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
uint32_t bg = (uint32_t)((uint32_t)(*(uint16_t *)&c2) | ((uint32_t)(*(uint16_t *)&c2) << 16)) &
^~~~~~~~~~~~~~~
/home/amirgon/projects/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_color.h:592:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
uint32_t fg = (uint32_t)((uint32_t)(*(uint16_t *)&c1) | ((uint32_t)(*(uint16_t *)&c1) << 16)) & 0x7E0F81F;
^~~~~~~~~~~~~~~
/home/amirgon/projects/lv_micropython/lib/lv_bindings/lvgl/src/misc/lv_color.h:592:74: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
uint32_t fg = (uint32_t)((uint32_t)(*(uint16_t *)&c1) | ((uint32_t)(*(uint16_t *)&c1) << 16)) & 0x7E0F81F;
^~~~~~~~~~~~~~~
```
### To Reproduce
- Install esp-idf 4.4 (probably will happen with any other version as well)
- run `. ./export.sh` on esp-idf dir to setup esp-idf
- Build lv_micropython esp32 port with this command: `make -C ports/esp32 LV_CFLAGS="-DLV_COLOR_DEPTH=16" BOARD=GENERIC_SPIRAM`
This problem only happens when setting `LV_COLOR_DEPTH`
CC: @kisvegabor
I see this is an issue on lvgl github.
Thank you very much.
It should be fixed now in LVGL.
1 Like