-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a port which outputs a set of .c files for embedding into a project #9529
Conversation
Excellent!! I have been looking forward to this, and it's an overall better and more flexible approach than the libmicropython.a port. As with #5964 I think we should replace the existing embedding example. It isn't particularly useful and adds more confusion because it's so tied into the unix port. But like the existing embedding example, it would be good to make the example also includes things like defining modules and QSTRs etc. (i.e. it needs to be an input to the genhdr files). |
Yes, I've done this on the project this was based on. But IMO it's worth having an "absolute minimum" example. And then we can add another example with more complicated use cases. |
77537cd
to
5c6e581
Compare
I have replaced the existing embedding example with this new one. |
9d60d5a
to
e8d57fd
Compare
Code size report:
|
Codecov Report
@@ Coverage Diff @@
## master #9529 +/- ##
=======================================
Coverage 98.50% 98.50%
=======================================
Files 155 155
Lines 20537 20537
=======================================
Hits 20229 20229
Misses 308 308 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
e8d57fd
to
81c6acc
Compare
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
81c6acc
to
4f3780a
Compare
Hello, I just ran into a little problem using embed port. NOTE: The python script will be used to customize the esp32 firmware behaviour, which will be mostly written in C/C++. Here is my "workflow":
Things start to go bad when I copied the The problem happens while generating the I tried to workaround this by passing a (dirty and) extra The workaround I now have locally, is to rather pass a
I'm not sure if this is a good idea or not ? esp-idf is deprecating makefile support, maybe a cleaner and more integrated solution would imply to rewrite the Makefile to a CMakelist ?? I'm not very fluent in cmake, and just enough in makefile, so i'm no expert at all here, please share any though or advice ! Thanks in advance, |
@SKZ81 Unfortunately I think what you're trying to do here is a bit tricky, I'd recommend opening a Discussion to talk about rather than discussing here in this merged PR. The description of what you've done here is really clear, but if you're making a discussion please clarify exactly what outcome you want in the post: the embed port is intended to embed a custom scripting language in another program, with some custom bindings between the Python code and the host program. If your goal is to do this then I think it's possible with some translation from the generated embed port Makefile and an ESP-IDF component's CMakeLists.txt. OTOH if your goal is to embed the entire esp32 port in an unrelated ESP-IDF project (i.e. including |
This is another way to embed MicroPython into a custom project with a custom build system.
It has two steps:
This is an alternative to #5964.
TODO: