ESP32 Micropython build errors... LOTS

I hope there is enough here for someone to identify the problem.
Tool versions and comments below.

(bild-lvgl) rich@RG-x360:~/lvgl/lv_micropython$ make V=1 -C ports/esp32 LV_CFLAGS="-DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=1" BOARD=GENERIC PYTHON=python2 deploy
make: Entering directory ‘/mnt/c/tpi-dev/lvgl/lv_micropython/ports/esp32’
Building with ESP IDF v4
find: ‘/home/rich/lvgl/esp/esp-idf/components/xtensa-debug-module/include’: No such file or directory

… loads of errors

printf("%s%s\n", FATAL_EXCEPTION, msg);
/home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.cpp: In function ‘void __cxx_fatal_exception_int(int)’:
/home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.cpp:35:5: error: ‘printf’ was not declared in this scope
printf("%s (%d)\n", FATAL_EXCEPTION, i);
/home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.cpp:35:5: note: ‘printf’ is defined in header ‘’; did you forget to '#include '?
Makefile:770: recipe for target ‘build-GENERIC//home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.o’ failed
make: *** [build-GENERIC//home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.o] Error 1
make: Leaving directory ‘/mnt/c/tpi-dev/lvgl/lv_micropython/ports/esp32’
(bild-lvgl) rich@RG-x360:~/lvgl/lv_micropython$

Using Windows Subsystem for Linux…

BOARD is Adafruit HUZZAH32 – ESP32 Feather Board

$ printenv (not all)
LESSCLOSE=/usr/bin/lesspipe %s %s

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

$ git describe esp-idf version

$ xtensa-esp32-elf-gcc --version
xtensa-esp32-elf-gcc (crosstool-NG esp32-2019r1) 8.2.0

$ cmake --version
cmake version 3.10.2

$ python -V
Python 2.7.17

$ python3 -V
Python 3.6.9

I am totally exhausted with trying to build these binaries.
I’ve been on other fourms. see PM-TPI
it says it all.

I would like to see the LittlevGl team make YouTube videos starting with installing and running ESP-IDF and LittlevGl tools.
Especially using WSL on Windows that is becoming very popular and easy.


Hi @GC-RmG!

What you call the “LittlevGL team” consists mostly of volunteers who spend their free time building and improving this excellent open source library.
If someone volunteers making some videos it could be nice, but I don’t think this is a priority. At least not for me.

It’s easy if you have Windows installed.
For many of us who only use Linux - it’s irrelevant.

I’m sorry to hear that.
I can try helping you, although I’m not sure what the problem is.
But I can tell you that many are building the binaries without any issues.

First step is to identify if the problem is related to Micropython or to lv_micropython.

  • Please try to build Micropython binaries without lvgl (not lv_micropython), in your environment. lv_micropython is based on Micropython, so let’s first see if that is building ok.
    Clone it, checkout version v1.12 and follow the README that explains how to build the ESP32 port.
  • Micropython v1.12 supports two versions of ESP-IDF. Before building Micropython you need to select one of them and checkout that exact version of esp-idf by checking out that specific hash.
  • When building the ESP32 you need to select your specific board. If your board is not supported, select a generic board or define your own board.
  • Another thing you can try is building the unix port instead of the ESP32 port, to see if the problem is limited to ESP-IDF or not.

If you get stuck there, then the right place to ask is the Micropython forum which you are already familiar with.

lv_micropython is based on Micropython v1.12, so once you can build Micropython it should be easy to move on and build lv_micropython.
The errors you showed us are related to ESP-IDF so I suspect they are related to building Micropython on your environment, and not related to lv_micropython.

Please try these suggestions and tell us how it goes.
Read all the docs, follow the instructions and I’ll try to help you if I can.

When you eventually succeed building it - you are welcome to make some YouTube videos as you suggested and share them with us!

I DID and built the micropython binary’s with no problem!
I am using Supported git hash (V4.0-beta1) that your package requires, and I can’t complete the build!
Those errors are displayed near the end of building.
You are not able to look at those errors and identify the possible cause(s)?

I’ve never worked with ESP-IDF (so I’m just working off the errors I see), but what you’ve shown makes it look to me like some files that are expected to be present don’t exist.

‘/home/rich/lvgl/esp/esp-idf/components/xtensa-debug-module/include’: No such file or directory
error: ‘printf’ was not declared in this scope

Is it possible that ESP-IDF isn’t downloaded fully?

OT: I saw on the forum thread you linked that you had tried the web simulator and it didn’t work. I recently fixed the web simulator in Chrome and it should be working now.

Because all your errors are related to ESP-IDF (under /home/rich/lvgl/esp/esp-idf/components).
lv_micropython does not change anything related to the way ESP-IDF is used.

Your errors don’t even make sense.

For example,

/home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.cpp:35:5: error: ‘printf’ was not declared in this scope
printf("%s (%d)\n", FATAL_EXCEPTION, i);
/home/rich/lvgl/esp/esp-idf/components/cxx/cxx_exception_stubs.cpp:35:5: note: ‘printf’ is defined in header ‘’; did you forget to '#include '?

Looking at cxx_exception_stubs.cpp, it’s including <cstdio> which declares printf.
So, from the error, it looks like on your environment <cstdio> does not declare printf!

Possibly there were other errors closer to the beginning (i.e. where … loads of errors was put) that were more useful?

lvgl-error-output.txt (382.0 KB)
see this micropython post…

I think this problem is also Makefile related

You said that you built Micropython (v1.12), why didn’t you see the same problem there?

Anyway, please try their PR, if it works well I’ll integrate it into lv_micropython.

As I stated in the micropython forum…

Or better yet if someone can make completed binaries, this would be great!
I think LittlevGL should also have a download page with firmware’s like Micropython does. Having pre-built binaries gives new developers the opportunity to get right to coding, testing, and evaluating LittlevGL without all the “building” hassles.

I seriously do not have the time nor the understanding of the Linux make build system to do these tools justice.
I would greatly appreciate if someone would Port ESP32 GENERIC and GENERIC-SPIRAM
binaries with IL9341 driver using esp-idf v4.0 and post them here.


The problem with your request is that a given binary will only work for specific board with specific display with specific ESP-IDF with specific lvgl configuration (lvgl is configured by changing lv_conf.h).
Any combination of these means different binaries.

Have a look how many different binaries Micropython provides only for ESP32. I counted 17 different binaries!
And this number needs to multiply by the number of lvgl specific configurations.

So I understand your desire to skip the build process and “just use a binary”, but as things currently stand, if you want to use lv_micropython you need to carefully configure it for your specific needs and build it yourself (or hire someone who would do it for you, if you “don’t have the time nor the understanding” as you said).

1 Like

In my humble opinion, it’s difficult as an open source project to provide prebuilt binaries for embedded hardware. New boards are always being released, and (as @amirgon mentioned) even one board can have many different configurations.

Our approach thus far has generally been to offer simulator projects for the PC that don’t require much effort to set up and start using, and make porting LittlevGL to a new platform as simple as possible. The idea is that if you find LittlevGL useful, you’ll be willing to undergo the effort required to get it working on your hardware.

We do have a number of starter projects available for common evaluation boards, but these usually end up being made available because one of us uses that board as a test platform for changes. These projects also suffer from the issue of rapid evolution. For example, we do not have any STM32H7 project available despite that chip having been released in 2017. It’s not a huge problem, because we do have an STM32F7 project and the two processors are very similar, but it’s still something that would be nice to have.

Keep in mind that lv_micropython is a very recent innovation. Support was only added 1 year ago. Therefore, it hasn’t had as much time to evolve and get tested as LittlevGL itself (although @amirgon does an excellent job of keeping it up to date and bug-free :+1:).

Perhaps, in the future, we could consider offering pre-built binaries, but I think it’s too early for that at the moment, and we don’t have the resources available to maintain enough binaries for all boards at the moment.

I’ll CC @kisvegabor on this conversation in case he has any other thoughts.

1 Like