MicroPython has a feature that allows a developer to compile their own libraries and then include them within the MicroPython kernel. These modules are often called frozen modules because they are compiled into bytecode. There are several advantages to compiling a module into a frozen module, including the following:
- The Python module cannot be modified without flashing the kernel.
- The module is compiled into bytecode, which keeps the source code away from prying eyes.
- Updating the application scripts is faster because there are fewer modules to update.
- If something goes wrong with the filesystem and it gets set back to default, the compiled modules will still be present and can be called as part of the default script to get the system back into a safe state.
- You can put the compiled module into zero wait RAM if it has speed-critical functionality...