-
|
Hello everyone, I just stumbled across the following issue: No code from my Is it possible to have Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
|
There should be very little code in boot.py, it should only be doing the bare minimum to set up filesystems so that main.py can be found, pre-compiling it will not make much difference. main.py can then import pre-compiled files. |
Beta Was this translation helpful? Give feedback.
-
|
Compiling boot.py may not make much difference, but compiling main.py may make it. I think it would be great to load main.mpy or fallback to main.py if it doesn't exist (or the reverse way). At least, it would be great to have a flag in compilation to activate it. |
Beta Was this translation helpful? Give feedback.
-
|
My "main.py" is just a line: "import real_main", and that is a mpy ;-) |
Beta Was this translation helpful? Give feedback.
-
|
But, yes, boot and main should be able to be MPY too. |
Beta Was this translation helpful? Give feedback.
-
|
For esp32 you can find the entry point here: https://github.com/micropython/micropython/blob/master/ports/esp32/main.c#L152C19-L152C40 The question is, how is the function called, which loads mpy files instead of py files. |
Beta Was this translation helpful? Give feedback.
boot.pymust be .py not .mpy. (Same goes for main.py too)There should be very little code in boot.py, it should only be doing the bare minimum to set up filesystems so that main.py can be found, pre-compiling it will not make much difference.
main.py can then import pre-compiled files.