|
4 | 4 | Build and Flash MicroPython |
5 | 5 | =========================== |
6 | 6 |
|
| 7 | +micro:bit V1 |
| 8 | +============ |
| 9 | + |
| 10 | +This applies to MicroPython for the micro:bit V1, the source of which can be |
| 11 | +found here: `bbcmicrobit/micropython <https://github.com/bbcmicrobit/micropython>`_. |
| 12 | + |
7 | 13 | Dependencies |
8 | 14 | ------------ |
9 | 15 |
|
@@ -68,8 +74,54 @@ is added to the script.:: |
68 | 74 |
|
69 | 75 | It also accepts data on standard input. |
70 | 76 |
|
| 77 | + |
| 78 | +micro:bit V2 |
| 79 | +============ |
| 80 | + |
| 81 | +This applies to MicroPython for the micro:bit V2, the source of which can be |
| 82 | +found here: `microbit-foundation/micropython-microbit-v2 <https://github.com/microbit-foundation/micropython-microbit-v2>`_. |
| 83 | + |
| 84 | +The repository also contains a history of |
| 85 | +`MicroPython firmware builds <https://github.com/microbit-foundation/micropython-microbit-v2/actions>`_. |
| 86 | + |
| 87 | +Dependencies |
| 88 | +------------ |
| 89 | + |
| 90 | +- `Arm GCC <https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads>`_ |
| 91 | +- `GCC <http://gcc.gnu.org/install/>`_ |
| 92 | +- `CMake <https://cmake.org/>`_ |
| 93 | +- `git <https://git-scm.com/>`_ |
| 94 | +- `Ninja <https://ninja-build.org/>`_ |
| 95 | +- `Python <https://www.python.org/downloads/>`_ |
| 96 | + |
| 97 | +Build MicroPython |
| 98 | +----------------- |
| 99 | + |
| 100 | +Clone the repository and change directory to it:: |
| 101 | + |
| 102 | + $ git clone https://github.com/microbit-foundation/micropython-microbit-v2 |
| 103 | + $ cd micropython-microbit-v2 |
| 104 | + |
| 105 | +Update the submodules:: |
| 106 | + |
| 107 | + $ git submodule update --init |
| 108 | + |
| 109 | +Then build the MicroPython cross-compiler:: |
| 110 | + |
| 111 | + $ make -C lib/micropython/mpy-cross |
| 112 | + |
| 113 | +After setting up, go to the src/ directory and build:: |
| 114 | + |
| 115 | + $ cd src |
| 116 | + |
| 117 | + $ make |
| 118 | + |
| 119 | +The resulting firmware will be ``MICROBIT.hex`` in the ``src/`` |
| 120 | +directory which can be copied to the micro:bit. |
| 121 | + |
| 122 | + |
71 | 123 | Flashing the micro:bit |
72 | | ----------------------- |
| 124 | +====================== |
73 | 125 |
|
74 | 126 | The micro:bit mounts itself as a USB mass storage device named ``MICROBIT``. |
75 | 127 | When it detects that a .hex file has been copied to the USB drive, it will |
|
0 commit comments