A custom deployment of MicroPython designed specifically for Monocle. Read the docs.
-
Download the latest
.hex
file from the releases page. -
Ensure you have the nRF Command Line Tools installed.
-
Connect your debugger as described here.
-
Flash your device using the command:
nrfjprog --program *.hex --chiperase -f nrf52 --verify --reset
-
Ensure you have the ARM GCC Toolchain installed.
-
Ensure you have the nRF Command Line Tools installed.
-
Clone this repository, submodules and build:
# Clone and jump into this repo git clone https://github.com/brilliantlabsAR/monocle-micropython.git cd monocle-micropython # Initialize the submodules git submodule update --init git -C micropython submodule update --init lib/micropython-lib # Build mpy-cross toolchain make -C micropython/mpy-cross
-
You can now close the terminal and open the project in VSCode.
There are three build tasks already configured and ready for use. Access them by pressing
Ctrl-Shift-P
(Cmd-Shift-P
on MacOS) →Tasks: Run Task
.- Build (
Ctrl-B
/Cmd-B
) - Build & flash
- Clean
- Build (
-
Download and install nrfutil including the
nrf5sdk-tools
package:chmod +x nrfutil # Make sure to add nrfutil to your path nrfutil install nrf5sdk-tools
-
Generate a settings file:
nrfutil settings generate --family NRF52 --application build/application.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 build/settings.hex
-
Download and install the
mergehex
tool which is a part of the nRF Command Line Tools. -
Merge the settings, bootloader, softdevice and application hex files:
mergehex -m build/settings.hex build/application.hex softdevice/s132_nrf52_7.3.0_softdevice.hex bootloader/build/nrf52832_xxaa_s132.hex -o build/release.hex
-
Create the DFU zip package using the command:
nrfutil pkg generate --hw-version 52 --application-version 0 --application build/application.hex --sd-req 0x0124 --key-file bootloader/published_privkey.pem build/release.zip
For information on developing and flashing the FPGA binary. Check the Monocle FPGA repository.