← index #15654Issue #17245
Related · high · value 3.203
QUERY · ISSUE

Build embed with C modules isn't working

openby volodymyr-zvarun-globallogicopened 2024-08-13updated 2025-03-03
enhancementport-embed

Port, board and/or hardware

embed

MicroPython version

MicroPython v1.22.2 on 2024-08-13; linux [GCC 4.2.1] version

Reproduction

  1. Modify examples/embedding/main.c by adding import cexample into second example
  2. From examples/embedding run
make -f micropython_embed.mk USER_C_MODULES=<micropython_path>/examples/usercmodule
make
  1. 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

CANDIDATE · ISSUE

USER_C_MODULE impossible to import library

closedby doboduopened 2025-05-04updated 2025-05-08
bug

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

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied