Closed crouse12 closed 4 years ago
Yes. No problem with mpy-cross. Th eproblem is getting a compiled version of mpy-cross. If you have set up your toolbox to compile the firmware youself, you will find it at:
.../MaixPy/components/micropython/core/mpy-cross
then you can compile your .py files e.g. with
mpy-cross myfile.py
which creates myfile.mpy. On the device, mpy files can be imported just like .py files.
I try to compile my mpy file today. First, I compile my .py file to .mpy and upload to my maixbit. However, the compiled .mpy file cannot work. I think this is because my firmata verion in maixbit is only v0.3.2. Therefore, I try to compile all maixpy and upload maixpy.bin to my maixbit with kflash maixpy.bin. maixpybin.py is in /MaixPy/maixpy_k210. However, my mpy file still cannot work. Finally, I upload maixpy_v0.3.2_full.bin to my maixbit. Unfortunately, boot.py cannot work now. I found that there are two boot.py and two freq.conf on my maixbit. //boot.py cannot be deleted.
I found it, so maixbit works now. https://github.com/sipeed/MaixPy/issues/139 However, I still cannot compile my mpy file. Could you give me v0.3.2 micropython firmata source code?
which mpy-cross version did you use to compile the .py file. You have to take it from the build tree of the MaixPy firmware, not from a different source. Exactly which error message do you get?
I download branch historic of maixpy and use it to compile my mpy. This compiled mpy works now.
Tried this now. Built mpy-cross within Maixpy micropython core, then used a boot.py file which call .mpy modules I compiled with mpy-cross.
The modules are found, but micropython accuses syntax error.
Is there any argument needed beyond mpy-cross myfile.py
? I read that there's the march
argument to specify architecture, but it seems RiscV is not supported.
Is it possible to make mpy file for maix bit?