-
Notifications
You must be signed in to change notification settings - Fork 535
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
interpreters/micropython: Add Micropython support to NuttX (WIP) #840
base: master
Are you sure you want to change the base?
Conversation
Awsome work @mransom-campbell ! I also got interested in MicroPython and NuttX :-) How can I help? :-) |
@cederom thanks for your interest! I actually got stuck trying to run the Micropython test suite. Here's the approaches I tried:
If you could help get the test suite working on either of those approaches that would be helpful. I have a solution to the Float issue but I haven't pushed that to this branch yet. I was working on this for a Research project at work so I'm not sure how much more time I can dedicate to this. |
|
Update:
|
I've been able to get these rebased to the latest master, including the minor changes to the unix target in upython, but it fails on finding a If you can get a basic interpreter to build, then I think this is doable pretty quickly Of course, moving the device drivers might be harder. |
Actually, https://github.com/adafruit/circuitpython/tree/main/ports/cxd56 since CircuitPython supports the NuttX SPRESENSE board, it could be quicker. The drivers would need to be generalized a bit, but otherwise it looks clean enough. |
Source code which contain main need to be added to MAINSRC since the build need rename the main symbols to avoid the conflict.
|
Got it to work, with caveats: This is on a SPRESENSE CXD5602 board. Can exit via |
a full port of micropython must not be based on the unix port but on the embed port. micropython/micropython#13632 (comment) This is very easy to embed in the Nuttx build system, I have that part working somewhere. I also have some WIP for a nuttx micropython, but it has to be clever and integrate properly, for example with mbedtls, already provided by NuttX. we should not be using the mbdedtls from micropython itself. Every other integration point has to be checked, or the port will be awkward. |
while i have some sympathies, i suspect it depends on what you want to do in your python code. |
I would say it depends on the project it is integrated in, in this instance NuttX. Micropython is still micropython, and whats available in it does not directly depend on the kind of port structure, but rather its configuration. |
I could use some feedback on this. It is still a WIP but it is taking longer than expected so I wanted to get this out there.
Summary
Micropython is a Python implementation for Microcontrollers. I think it is a perfect fit for NuttX.
This PR adds NuttX as a Unix "Variant" under Micropython. This allows lots of features like files, sockets, etc.. to work without maintaining a separate Micropython port for NuttX.
Notes:
anyone has a better solution let me know.
TODO:
Impact
Application.mk: changed OBJS to be += so Applications can add their own object files manually.
Testing
I have tried a few things on a stm32 board and Renesas RX board, everything seems to work. The full Micropython test suite should be run before this PR is merged.