Skip to content

Commit

Permalink
docs/develop: Add notes on prerequisite tools for building native .mpy.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Sep 25, 2020
1 parent 81f2162 commit c8ade2b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/develop/natmod.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ language which can be compiled to stand-alone machine code can be put into a

A native .mpy module is built using the ``mpy_ld.py`` tool, which is found in the
``tools/`` directory of the project. This tool takes a set of object files
(.o files) and links them together to create a native .mpy files.
(.o files) and links them together to create a native .mpy files. It requires
CPython 3 and the library pyelftools v0.25 or greater.

Supported features and limitations
----------------------------------
Expand Down Expand Up @@ -179,6 +180,14 @@ The file ``Makefile`` contains:
Compiling the module
--------------------

The prerequisite tools needed to build a native .mpy file are:

* The MicroPython repository (at least the ``py/`` and ``tools/`` directories).
* CPython 3, and the library pyelftools (eg ``pip install 'pyelftools>=0.25'``).
* GNU make.
* A C compiler for the target architecture (if C source is used).
* Optionally ``mpy-cross``, built from the MicroPython repository (if .py source is used).

Be sure to select the correct ``ARCH`` for the target you are going to run on.
Then build with::

Expand Down

0 comments on commit c8ade2b

Please sign in to comment.