Build embed with C modules isn't working
Port, board and/or hardware
embed
MicroPython version
MicroPython v1.22.2 on 2024-08-13; linux [GCC 4.2.1] version
Reproduction
- Modify
examples/embedding/main.cby addingimport cexampleinto second example - From
examples/embeddingrun
make -f micropython_embed.mk USER_C_MODULES=<micropython_path>/examples/usercmodule
make
- Run embed binary
Expected behaviour
Expected to start without errors
Observed behaviour
Traceback (most recent call last):
File "<stdin>", in <module>
ImportError: module not found
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
USER_C_MODULE impossible to import library
Port, board and/or hardware
ESP32S3 (16MB of Flash & Octal-SPIRAM)
MicroPython version
MicroPython v1.26.0-preview.59.g79abdad9e.dirty on 2025-05-04
Build with ESP-IDF 5.4.1 toolchain
Hi, I've been upgraded Micropython to 1.26 and ESP-IDF to 5.4.1 since a bug report in my own repository.
I compile the firmware a usual (it was working with micropython 1.25 and ESP-IDF 5.3.2) without issue, However I cannot import the module as before. (import xxx lead to an ImportError: no module named 'xxx')
The help('modules') command shows usual library but not the one from the User_C_module (before I used to see xxx module)
The build command was
make BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=FLASH_16M_SPIRAM_OCT USER_C_MODULE=~/pico/XXX/xxx
I thought Issue #16424 would have closed the issue but no luck...
I'm not sure it's a bug, but I does look like...
Reproduction
make BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=FLASH_16M_SPIRAM_OCT USER_C_MODULE=~/pico/XXX/xxx
Was working well with Micropython v1.25.0-preview.180.g495ce91ca.dirty on 2025-02-15 & IDF 5.3.2
Was not working with Micropython v1.26.0-preview.59.g79abdad9e.dirty on 2025-02-15 & IDF 5.3.2
So I expect it is not related to IDF version
Expected behaviour
Normal output is
import xxx ==> Nothing (OK)
Observed behaviour
Observed output is
import xxx ==> ImportError: no module named 'xxx'
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree