• Home
  • Annotate
  • current directory
Name
Date
Size
#Lines
LOC

..29-Oct-2021-

.gitignore A D29-Oct-202110 21

Makefile A D29-Oct-20211.5 KiB6336

README.md A D29-Oct-20211.1 KiB3220

gccollect.c A D29-Oct-20211.5 KiB4311

main.c A D29-Oct-202113.5 KiB351278

mpconfigport.h A D29-Oct-20215.8 KiB169115

mphalport.h A D29-Oct-202163 31

mpy-cross.vcxproj A D29-Oct-20215.5 KiB106106

qstrdefsport.h A D29-Oct-202131 20

README.md

1MicroPython cross compiler
2==========================
3
4This directory contains the MicroPython cross compiler, which runs under any
5Unix-like system and compiles .py scripts into .mpy files.
6
7Build it as usual:
8
9    $ make
10
11The compiler is called `mpy-cross`.  Invoke it as:
12
13    $ ./mpy-cross foo.py
14
15This will create a file foo.mpy which can then be copied to a place accessible
16by the target MicroPython runtime (eg onto a pyboard's filesystem), and then
17imported like any other Python module using `import foo`.
18
19Different target runtimes may require a different format of the compiled
20bytecode, and such options can be passed to the cross compiler.  For example,
21the unix port of MicroPython requires the following:
22
23    $ ./mpy-cross -mcache-lookup-bc foo.py
24
25If the Python code contains `@native` or `@viper` annotations, then you must
26specify `-march` to match the target architecture.
27
28Run `./mpy-cross -h` to get a full list of options.
29
30The optimisation level is 0 by default. Optimisation levels are detailed in
31https://docs.micropython.org/en/latest/library/micropython.html#micropython.opt_level
32