Skip to content

Building From Source

Keir Fraser edited this page Feb 8, 2023 · 10 revisions

FlashFloppy can be built from source either manually in a suitable Linux environment, or using a pre-built Docker image.

Manual Method

This project is cross-compiled on an x86 Ubuntu Linux system. However other similar Linux-base systems (or a Linux virtual environment on another OS) can likely be made to work quite easily.

The following instructions apply specifically to Ubuntu 20.04. You can see them applied in practice in FlashFloppy's CI workflow file.

To install the prerequisites:

 # sudo apt -y install git gcc-arm-none-eabi python3-pip srecord stm32flash zip unzip wget
 # python3 -m pip install --user crcmod intelhex

To build the FlashFloppy firmware:

 # git clone https://github.com/keirf/flashfloppy.git
 # cd flashfloppy
 # make dist

If you wish to build firmware incrementally, for example for development testing, then you can build all targets as follows (you can modify or remove the -j8 parameter to adjust build parallelism):

$ make -j8

You will now find HEX files for flashing at:

out/<mcu>/<level>/<target>/target.hex
<mcu> := at32f435 | stm32f105
<level> := debug | logfile | prod
<target> := floppy | io_test | quickdisk

You can flash the relevant HEX to your Gotek via serial or ST-Link. The flash and ocd build targets may be useful for automatically doing this on Linux, via serial adapter or OpenOCD/ST-Link.

The debug targets log to the serial line at 3Mbps. If this is too fast for your host you can reduce it (for example, to 115200) by modifying the definition of BAUD at the top of src/console.c.

For example, to build the AT32F435 firmware with debug logging, and automatically Flash an attached Gotek via ST-Link and OpenOCD:

$ make -j8 ocd target=at32f435/debug/floppy

Docker

Urban Jonnson has uploaded a Docker image which will create the FlashFloppy distribution zip file from the following command line:

 # docker run -v $(pwd):/output --rm -ti planeturban/docker-flashfloppy