micropython / micropython/micropython

Build embed with C modules isn't working

Open
#15,654 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement port-embed
Dominant language
C
Stars
22.1k
Forks
9k
Avg merge
6d 4h
Merged PRs (30d)
16

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/embedding/main.c and the examples/usercmodule directory. Reproduce the issue from examples/embedding using the two make commands and run the embed binary, then trace why the added cexample import is unavailable. Done means the embed binary starts without the reported ImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.