Closed dotnfc closed 1 year ago
trying to build lv_mpy for esp32-s2, but get some compiling & linking errors.
We don't currently support esp32-s2, but I'll be happy to help any community-driven effort to add this support.
theose eth_pyy_xxx may not be available for s2 chip, and the gpio_force_hold_all() in {esp-idf}\components\driver\gpio.c:
The esp-idf micropython module is auto-generated and contains a lot of bindings to functions (or structs) we don't really need. I don't see why we need esp_eth_phy_*
or anything that rely on them, for example.
The automatic binding script scans header files and binds everything by default, but we can exclude specific headers.
The binding script starts with a root header file (driver/esp32/espidf.h
) and processes all headers that it includes recursively. Unfortunately these headers eventually include much more than we really need.
There are two ways to exclude headers:
lv_espidf.c.pp.filtered
.So I suggest you try to filter irrelevant headers. This would also reduce program size since the binding code would be smaller.
When this works for you, we'll appreciate a PR to lv_binding_micropython!
thanks for your comments, i'll try for getting esp32-s2 supported.
those esp_eth_phy_xxx symbols may be imported by 'mdns.h', but if i move the #include 'mdns.h' to espidf.c, failed on compiling frozen_contents.c
frozen_content.c:15963:17: error: 'MP_QSTR_ip' undeclared here (not in a function);
this is uftpd.py stuff
def num_ip(ip):
items = ip.split(".")
...
so complicated. ^^
but if i move the #include 'mdns.h' to espidf.c
Don't remove 'mdns.h', it will remove functionality. You can find out which headers define esp_eth_phy_xxx and add them to the FILTER exclusion list in mkrules.cmake.
failed on compiling frozen_contents.c
uftpd.py is not dependant on that. Probably a build dependencies problem, try to clean and rebuild.
@amirgon against the current master (65304b6), I'm trying:
make BOARD=GENERIC_S2
My compilation gets further with @dotnfc's steps in the first post above, but now I'm getting stopped at:
modrtch.c:409:23: error: 'ADC_WIDTH_BIT_12' undeclared (first use in this function); did you mean 'ADC_WIDTH_BIT_13'?
adc1_config_width(ADC_WIDTH_BIT_12);
^~~~~~~~~~~~~~~~
ADC_WIDTH_BIT_13
I'm strictly a python guy so figuring out a fix from here is beyond me, unfortunately.
I'm strictly a python guy so figuring out a fix from here is beyond me, unfortunately.
The S2 board, apparently, has different ESP-IDF API than the standard ESP32.
At the moment I don't have the time to study the differences and put the effort to support other ESP32 variations such as S2.
If someone from the community would like to volunteer, I would be happy to review a PR for that.
But this would require come C knowledge and the willingness to spend time on this, read ESP documentation, etc.
Understood. I'm rallying more C-savvy folks to try to take a look.
If you had to blindly guess, does this seem like a couple hours of work or are we more in the days or weeks range?
If you had to blindly guess, does this seem like a couple hours of work or are we more in the days or weeks range?
It may be just a couple of hours, but I really can't tell without looking into it.
And obviously, you'd need an S2 development board, preferably with JTAG so you could debug it.
Closing in favor of https://github.com/lvgl/lv_binding_micropython/issues/227
trying to build lv_mpy for esp32-s2, but get some compiling & linking errors.
i have to make change,
e.g. espidf.h
modrtch.c
but , when linking,
theose eth_pyy_xxx may not be available for s2 chip, and the gpio_force_hold_all() in {esp-idf}\components\driver\gpio.c:
it should not be put in 'lv_espidf.c.pp.filtered' for esp32-s2, rigth?
any suggestion?