Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Method 1: Serial Programming
Serial programming requires a USB-TTL adapter, readily available on Ebay or from project webstores:
- CAB-12977 from SparkFun
- Search "PL2303HX usb ttl adapter" on Ebay, available for around one dollar.
The Gotek is then jumpered in system-bootloader mode and programmed from the host PC. See the below picture for wiring and jumper selection. This Gotek has had pins soldered to the programming header. It is possible to make the required connections with no soldering, but be careful that all wires are sufficiently well connected. Also note that the ordering of the connections (5V,GND,TX,RX) can vary across adapters, so be careful to note the ordering on your own.
The programming process is described, along with suitable Windows software, on the Cortex firmware webpage. Of course, rather than using the Cortex HEX file, use the *.hex file contained in the FlashFloppy distribution.
If programming on Linux, you can follow the Cortex instructions to physically set up your serial connection and bootstrap the Gotek, and then use stm32flash to do the programming (for v0.10 in this example):
# sudo stm32flash -k /dev/ttyUSB0 # sudo stm32flash -vw FF_Gotek-v0.10.hex /dev/ttyUSB0
- On Windows, ensure the driver has correctly detected the USB-TTL adapter. In particular, PL2303 clones have trouble with the official Prolific driver.
- Ensure you have TX and RX wires the correct way round.
- Sometimes the STM32 bootloader gets confused or negotiates the wrong baud rate. Try resetting the Gotek by touching NRST to GND, or by removing and reapplying power.
- Some serial adapters require pull-up resistors on the TX and RX wires. See AN2606 ("STM32 microcontroller system memory boot mode"), Section 3.3, Figure 1. A suitable resistor value (R) is 10K; these can safely be connected to VCC/+V of 3.3V or 5V.
Method 2: USB Programming
This method requires a USB-A to USB-A cable, and you should program the *.dfu file contained in the FlashFloppy distribution.
For more details read Nick Lines' how-to guide, or watch the following Youtube video. Note: The *.dfu file is now included in the FlashFloppy distribution; there is no need to create it from the *.hex file and those steps can be skipped.
Linux / Mac
dfu-util command-line tool which can be downloaded via your
package manager (Linux), or Homebrew (on MacOS). Programming is then as simple
as (for v0.10 in this example):
sudo sfu-util -a 0 -s :unprotect:force -D FF_Gotek-v0.10.dfu sudo dfu-util -a 0 -D FF_Gotek-v0.10.dfu
The first line is only needed if the Gotek Flash is read-protected (this
is the case for factory-fresh Goteks). Since the
unprotect command resets
the Gotek, you may need to wait some seconds before issuing the second
command, while the DFU device is re-enumerated.
There are reports of some issues connecting as a DFU device to MacOS. In some cases this can be solved by connecting via an external USB hub.