Building Vanilla MicroPython for PYBD_SF2

Instructions

# Install GNU ARM embedded GCC on macOS.
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc

# Get the MicroPython sources.
git clone https://github.com/micropython/micropython
cd micropython

# Build MicroPython cross-compiler.
make -j6 --directory=mpy-cross

# Build firmware for specific architecture and board.
make -j6 --directory=ports/stm32 BOARD=PYBD_SF2

With module freezing

export FROZEN_MPY_DIR=~/dev/hiveeyes/sources/hiveeyes-micropython-firmware/dist-packages

With threading

Unsure which counts, so let’s just define both.

export MICROPY_PY_THREAD=1
export CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'

References

Enable DFU bootloader mode

For the pyboard D-series you must enter the mboot DFU bootloader by holding down the USR button, pressing and releasing the RST button, and continuing to hold down USR until the LED is white (4th in the cycle), then let go of USR while the LED is white. The LED will then flash red once per second to indicate it is in USB DFU mode. You can then program the firmware using a DFU programmer, eg dfu-util or pydfu.py.

MicroPython - Python for microcontrollers

Install firmware using dfu-util

make --directory=ports/stm32 BOARD=PYBD_SF2 USE_PYDFU=0 deploy

REPL signature

make console
MicroPython v1.11-328-gd96391aca on 2019-09-21; PYBD-SF2W with STM32F722IEK
>>>