Building firmware
Based on the instructions from PyCubed and CircuitPython. CircuitPython is meant to be built in a Unix (Linux, Mac, etc.) environment. While it is possible to build on Windows with the appropriate workarounds, it is not recommended.
Dependencies
If you are not on Linux, follow the instructions at the above links. For Ubuntu, the following packages are required:
You will need to install build-essential, gettext, and uncrustify by running
$ sudo apt install build-essential
$ # The version of uncrustify you need is in a PPA:
$ sudo add-apt-repository ppa:pybricks/ppa
$ sudo apt install git gettext uncrustify
The Pycubed-Mini board uses a Cortex-M build. Therefore it will require the ARM Cortex-M toolchain. Unfortunately, the ARM Cortex-M toolchain is not available through apt or snap. To install download the 10-2020-q4-major version.
Then extract it somewhere and add the following to your .bashrc (make sure to modify the path as required)
$ export PATH="$PATH:/home/user/path/to/gcc-arm-none-eabi-10-2020-q4-major/bin/"
Building
First fetch the code required to build. This should take a while, as many submodules are being donwloaded.
$ git clone https://github.com/adafruit/circuitpython.git
$ cd circuitpython
$ make fetch-submodules
Then install the required python dependencies
$ pip3 install --upgrade -r requirements-dev.txt
$ pip3 install --upgrade -r requirements-doc.txt
Then build the mpy-cross compiler via
$ make -C mpy-cross
Then download the pycubed-mini v3 firmware from here. Then create a pycubed-mini folder in the ports/atmel-samd/boards directory. Then place the firmware in the pycubed-mini folder.
Finally run the following command to build the firmware
$ cd ports/atmel-samd
$ make BOARD=pycubed-mini