Skip to content

Firmware Programming

Keir Fraser edited this page Oct 30, 2019 · 21 revisions

To build and program Greaseweazle you will need the following parts:

  • STM32 "Blue Pill" board
  • USB-TTL serial adapter
  • Firmware programming file (Download)

The "Blue Pill" is available very cheaply from many Chinese Ebay sellers for less than £2 including postage. The best search term is "STM32F103C8T6 board", sorted by lowest price first, and look for a board identical to below:

STM32 Blue Pill

Please note that other boards in other colours (eg. Black Pill) may have different pin configurations and may be more likely to contain counterfeit STM32 chips. I recommend to stick with the Blue Pill!

For programming you will need a USB-TTL adapter such as shown below, available for around £1-2 on Ebay. My own experience is with the PL2303HX-based adapters, which are automatically detected and initialised in Linux. In Windows the correct Prolific driver is installed, but since the cheap adapters are using cloned chips, the driver may fail to initialise the device. In this case the driver must be replaced by an older version and auto-update disabled for the driver, as described here.

Example USB-TTL serial adapter

Now adjust the yellow boot jumpers on the STM32 board and attach the Dupont jumper cables supplied with the USB-TTL adapter as shown. Note that 2.54mm header pins have been soldered for this purpose: you may wish to do similar at least for 5V, G, A9 and A10. In this example the cables connect back to the following USB-TTL pins: White to GND, Black to 5V, Purple to RXD, Blue to TXD.

Programming the STM32

Download the firmware zip file from here and program according to OS-specific instructions below. Once the device is programmed you should set both yellow boot jumpers to 0. This will cause the Greaseweazle firmware to run automatically when powered on.

Windows: The programming process is described, along with suitable Windows software, on the Cortex firmware webpage.

Linux: The firmware HEX image can now be programmed with the stm32flash command-line utility:

 # unzip Greaseweazle-v0.3.zip
 # sudo stm32flash -b 115200 -vw Greaseweazle-v0.3/Greaseweazle-v0.3.hex /dev/ttyUSB0