-
Notifications
You must be signed in to change notification settings - Fork 193
Firmware Programming
NOTE: If you have FlashFloppy installed on your Gotek, you do not need to follow these steps. Instead perform a Firmware Update.
The first installation of FlashFloppy firmware onto Gotek must be done either by USB or serial link to a host PC.
This method requires a USB-A to USB-A cable, a pair of jumper wires to configure the programming header of the Gotek, and the *.dfu programming file contained in the FlashFloppy distribution.
The latest Goteks are using Artery MCUs which require Artery-specific DFU programming software. A full guide can be found on msx.org, or a video guide on YouTube.
To configure the programming header of the Gotek, temporarily place jumper wires across the following pin pairs: Boot-3V and Tx-5V.
Because these jumper wires are temporary and only used for this initial programming, you can simply use short lengths of hookup wire. In doing so, ensure the exposed ends of your wires are not touching each other.
For more details 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.
Firstly, set the programming jumpers as described above, and detailed in the Windows tutorial video. Ignore the rest of the video, which is Windows-specific.
Connect the Gotek to your host using a USB-A to USB-A cable.
Programming requires the 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 v3.23 in this example):
sudo dfu-util -a 0 -s :unprotect:force -D FF_Gotek-v3.23.dfu
sudo dfu-util -a 0 -D FF_Gotek-v3.23.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.
A nice video summary of this method using programming software on Windows is available on Youtube courtesy of Kris Cochrane. It also includes the OLED Display and Piezo Sounder mods:
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.
Important Notes:
- Your Gotek may have a different number of header pins/holes, but any missing or extra pins are not used in the programming process.
- This Gotek has pins soldered to the programming header. It is possible to make the connections with no soldering, but take care that all wires are sufficiently well connected.
- The ordering of the connections (5V,GND,TX,RX) can vary across USB-TTL serial 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.