I've already tried to split code parts, delete modules, etc. But all that doesn't help. Only 2-3KB Ram remain free and quickly there is a MemoryError.
If I understood it right, there are two possibilities: "Freeze modules" and "precompiling to .mpy", right?jimmo wrote: ↑Sun Oct 06, 2019 2:32 am...when you run Python code off the flash filesystem, it needs temporary RAM to load the text, then it stores the compiled bytecode in RAM. When you freeze a module, neither the text nor the compiled bytecode need to live in RAM, it's executed directly off the flash.
Compiling to an .mpy helps a bit because the program text doesn't need to be loaded into RAM, but it still means the bytecode runs from RAM.
Both seem quite complex to me. It's just something else than only saving the .py files on the device.
Why are .mpy files not created and stored in the flash on a device with file system? That would help a lot, wouldn't it?
Where can I find instructions for "Freeze modules" and "precompiling to .mpy" ? I only found: http://docs.micropython.org/en/latest/r ... h-freezing which leaves many questions unanswered for me.