Hi everyone,
I am new to micropython and was trying to build nuttx with latest micropython using following method:
I reverted the commit in which micropython was supported then in the micropython makefile, I changed the micropython version from 1.3.8 to 1.12, then tried to build but got following error :
apps/interpreters/micropython/micropython-1.12/py/mphal.h:34:23: fatal error: mphalport.h: No such file or directory
#include <mphalport.h>
so I tried to search this file then it was in /mpy-cross and ports/unix folder then I tried to give the address manually
#include "mpy-cross/mphalport.h"
then it gave the following error:
apps/interpreters/micropython/micropython-1.12/py/builtin.h:81:29: error: conflicting types for 'mp_builtin_open_obj'
MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
tried to include using ports/unix but still got the same above error.
please check this and let me know why it didn't include mphalport.h by itself and how can I correct the 2nd error.
Thank in advance for the help.
Error in micropython porting
Re: Error in micropython porting
Hi,
It helps with these sort of questions to provide a lot more context and background. Fortunately I at least know what NuttX is, but more info always helpful (i.e. link to repo, which revision, which commands you're running, etc).
This is kind of the "embedding" scenario that has been discussed a few times recently but unfortunately there isn't a really good example of how to do this. micropython/examples/embedding is unfortunately quite convoluted and difficult to apply. (It's on my list, but there are lots of things on my list...) That said, it might be a good starting point for what you need to do -- the key thing to remember with it is that all of the Unix stuff can be ignored (e.g. moduos.c) and anything that includes code from the unix port.
It helps with these sort of questions to provide a lot more context and background. Fortunately I at least know what NuttX is, but more info always helpful (i.e. link to repo, which revision, which commands you're running, etc).
I suspect this is the key issue. A _lot_ has changed since 1.3.8.
I forget exactly when this was added (since 1.3.8) but it's a key thing that a port has to provide to define some common hardware-level methods. You can't just give it a different port's file as it will be different for every port (and generally there will be a corresponding mphalport.c to provide the actual implementation).
This is kind of the "embedding" scenario that has been discussed a few times recently but unfortunately there isn't a really good example of how to do this. micropython/examples/embedding is unfortunately quite convoluted and difficult to apply. (It's on my list, but there are lots of things on my list...) That said, it might be a good starting point for what you need to do -- the key thing to remember with it is that all of the Unix stuff can be ignored (e.g. moduos.c) and anything that includes code from the unix port.