Skip to content

Commit 0b996b5

Browse files
microbit-markmicrobit-carlos
authored andcommitted
docs: dev guide updates (#711)
Completes and merges build and flash pages. Adds V2 info. Removes outdated FAQ page. Adds WebUSB info to REPL page. Rebase update: Keeps and updates the flashing paragraph in flashfirmware page.
1 parent 354c2ed commit 0b996b5

File tree

3 files changed

+62
-136
lines changed

3 files changed

+62
-136
lines changed

docs/devguide/flashfirmware.rst

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
Build and Flash MicroPython
55
===========================
66

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+
713
Dependencies
814
------------
915

@@ -68,8 +74,54 @@ is added to the script.::
6874

6975
It also accepts data on standard input.
7076

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+
71123
Flashing the micro:bit
72-
----------------------
124+
======================
73125

74126
The micro:bit mounts itself as a USB mass storage device named ``MICROBIT``.
75127
When it detects that a .hex file has been copied to the USB drive, it will

docs/devguide/hexformat.rst

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,15 @@ found here: `microbit-foundation/micropython-microbit-v2 <https://github.com/mic
121121
This is a port of MicroPython to the micro:bit which uses CODAL as the
122122
underlying target platform.
123123

124-
After cloning this repository update the submodules::
125-
126-
$ git submodule update --init
127-
128-
Then build the MicroPython cross-compiler::
129-
130-
$ make -C lib/micropython/mpy-cross
131-
132-
After setting up, go to the src/ directory and build::
133-
134-
$ cd src
135-
136-
$ make
137-
138-
That will build both ``libmicropython.a`` (from source in ``src/codal_port/``) and the
139-
CODAL app (from source in ``src/codal_app/``). The resulting firmware will be
140-
``MICROBIT.hex`` in the ``src/`` directory which can be copied to the micro:bit.
124+
Running the ``make`` command executes the following steps:
125+
126+
- Create build output directory, run cmake, and make sure codal libraries
127+
exist (via cmake).
128+
- Build both ``libmicropython.a`` (from source in ``src/codal_port/``) and the
129+
CODAL app (from source in ``src/codal_app/``).
130+
- Run ``addlayouttable.py`` to add the layout table to the .hex file
131+
- Create the microbit-micropython firmware as ``MICROBIT.hex`` in the ``src/``
132+
directory, which can be copied to the micro:bit.
141133

142134
Including a user script
143135
-----------------------

docs/devguide/installation.rst

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)