The GreaseWeazle is a very cool project from Keir Frazer documented on his 'Greaseweazle Host Tools' and Greaseweazle: Firmware pages Github pages. The main entry points are the excellent Wiki and the Tutorial There are several variants of the STM MCUs that can be used for a GreaseWeazle. The cheapest is the Blue Pill. With the GreaseWeazle F1 floppy adapter board it is very compact and will fit in the back of a small floppy drive case. work for a single floppy drive.
If you want to connect two floppy drives to one GreaseWeazle, you should use the F7 or V4 version.
The first test is for to check the firmware and host tools are correctly installed. Make sure the STM32 board is connected. The GreaseWeazle board and a floppy drive are optional.Type:
gw info
The python script should respond with something like this:
Host Tools: 1.22 Device: Port: /dev/ttyACM0 Model: Greaseweazle F1 MCU: 72MHz, 20kB SRAM Firmware: 1.6 Serial: GWnnnnnnnnnnnnnnnnnnnnnnn USB: Full Speed (12 Mbit/s), 16kB Buffer
If not you should check the firmware is correctly installed.
Next is checking the GreaseWeazle boarda floppy disk drive and power supply are correctly connected. Put a floppy (any disk with an index hole should be ok. Type:
gw rpm
The floppy drive light should go on and the disk rotating. The response should \ look like this:
Rate: 360.410 rpm ; Period: 166.477 ms
360 rpm indicates a HD-drive running at high speed.. A DD-drive rpm would result in:
Rate: 300.391 rpm ; Period: 199.739 ms
For IBM-compatible drives this is controlled via pin2 of the floppy drive connector. The rotation speed (and density) are switched via pin 2.
gw pin set 2 l
Switches to low speed.
gw pin set 2 h
Switches to high speed.
Reading and decoding an unknown disk can be a challenge, so it is best to start with a well known format, like IBM 360K or 1.2M disks.
gw read --format=ibm.360 /tmp/test.imd
This reads each track from the disk and tries to interpret it as a 360 kByte, double sided PC-DOS disk.
gw write --drive a --format ibm.1200 Dos6.22-5.25.img
The same for a 1.2Mbyte, double sided PC-DOS disk. Make sure pin 2 matches the type of disk in the drive. DOS does this automatically, but gw doesn't.
These commands can be aborted with Ctrl-C
# erasing a 80 tr. disk (select high density for this): gw erase --tracks="c=0-80:h=0-1:step=1" # writing a 40 tr. image with a 80 tr drive (this will not read reliable on a 40 track drive): gw write --format=ibm.360 --tracks="c=0-80:h=0-1:step=2" /tmp/test.imd # read 40 tr, DS (read only track 0-39): gw read --format=ibm.360 /tmp/test.imd # write a 1.2 MByte HD-disk. The drive is in HD mode (default or via pin 2: gw write --drive a --format ibm.1200 Dos6.22-5.25.img # writing a DD 80 tr. image in a HD drive gw pin set 2 l gw write --drive=a --format=ibm.720 IBM\ DOS\ 3.3\ 720K\ Disk.img # writing a HD 80 tr. image in a HD drive gw pin set 2 H gw write --drive=a --format=ibm.1200 d1200.img # checking the number of tracks of a drive. This command moves the heads to track 40. gw seek 40
The TRS-80 formats are currently not supported by gw, but a gw2dmk program exists (derived from the old cw2dmk code for the Catweasel).
--tracks argument c - track range h - head range step - usually 1 or 2
This specification should describe how you want to read/write, not the physical type of the drive.
This text leans heavy on the tutorial from the Wiki.
Three levels of access for reading or writing any floppy disk:
The Greaseweazle reads the data at the flux level, writes the track to a file on the harddisk, and then optionally interprets this to formatted tracks or sector data. For this interpretation, you have to tell it what format is expected. For reading the flux-level the only data that has to be provided is the number of heads and tracks. Use the --tracks argument for this.
Disks with a known and supported format sized 3 1/2" and 5 1/4" are usually easy, 5 1/4" HD is the exception. (and maybe 8", untested).
When writing a image, GW forst writes a track and then tries to read it again. If this fails, it retries three times. If all retries fail, gw aborts.
Last update: 2025-06-03