you may or may not be able to set the following to turn it off. I would have to specifically check the MicroPython code to see if it is able to be done.
CONFIG_ESP_ERR_TO_NAME_LOOKUP=n
Here is a list of the options which can impact performance and binary size for the ESP32 line of MCU’s…
I do also recommend going through the config options for MicroPython to turn on and off features you will not use. Due to MicroPython being a runtime language there are a lit of things that get linked to in the ESP-IDF that you might not use. Things like the RMT or the Touch GPIOs. Everything that gets called from MicroPython’s C code gets compiled into the binary even if it goes unused so the author of MicroPython has coded in the ability to turn those things off and that can lead to a large savings in code. an example is if you are not going to use any crypto stuff. then you don’t need to compile that portion of MicroPython and that can lead to a really large savings in binary size.
To see what you can turn on and off check in themicropython/ports/esp32/mpconfigport.h file. There is a long list of options that can be turned on and off. There are also more MicroPython options that get specific to the moard you are using. so check the micropython/ports/esp32/boards/***/mpconfigboard.h file where *** is the BOARD you are using.
Also turn off ALL widgets you are not using in the lv_config.h file.
It is typical to see 2.5mb of flash use when compiling MicroPython with LVGL and leaving most things turned on in LVGL and leaving MicroPython and the ESP-IDF at their defaults.