It enables modules containing large constant data structures to be accessed with minimal RAM usage. By avoiding the need for runtime compilation it also reduces the time required to import a module.
Limitations (as I understand it): constant data such as floats and tuples can't be cross-compiled, nor can native and Viper code.
To use it, first ensure you can successfully clone the Micropython repo and build and deploy a standard firmware build (the README files in the project root and in stmhal are your friend).
The following instructions assume Linux on a PC and source dated 15th April 2016 or later. Navigate to the micropython source directory. Build the cross compiler with
Code: Select all
make -C mpy-cross
Code: Select all
../mpy-cross/mpy-cross scripts/fonts.py
ls -l scripts
Then issue (adapt the following for your board type):
Code: Select all
make BOARD=PYBV10 clean
make BOARD=PYBV10 FROZEN_MPY_DIR=scripts
Code: Select all
sudo make BOARD=PYBV10 deploy