The Blue Pill is a wonderful little board, and my first choice for many projects requiring a small and very low-cost µC board. Especially with PlatformIO’s excellent support for it.

Even for retrocomputing – the hobby of emulating old computers from decades ago – a Blue Pill can be used: see my recent Turning a Blue Pill into a Z80 article for an example. This could easily be extended further: adding more (external) RAM, flash, an SD card, etc.

The STM32F407

But there’s another more advanced range of STM32 µC’s which is also widely available online, from all the usual Chinese websites and outlets: the STM32F40x series.

Of these, by far the most widespread is the F407 (I’ll leave the STM32 prefix off most of the time, since the context is usually clear). It can run considerably faster, has quite a bit more memory, and includes a lot more peripherals that the basic F103 µC on a Blue Pill:

The FSMC exposes the internal address and data buses in such a way that external memory chips can be hooked up, with fast access from the CPU and DMA controller.

Looking at the the datasheet (202-page PDF) and reference manual (1747-page PDF), these chips were released in 2011 and have been around for years. Proven technology.

A good fit for retro use

A major benefit of the F407 over the medium-size F103 in the Blue Pill, is the amount of built-in RAM: 196 KB. This is more than sufficient for supporting a Z80 with not just 64 KB, but even with banked memory.

With banked memory, up to 3 banks of 48 KB plus one common bank of 16 KB could be allocated, or alternately 4 banks of 32 KB plus a common bank of 32 KB. This requires 160 KB, leaving a very comfortable 36 KB for other emulator and interface uses.

Another useful aspect of the F407, is that it comes in variants with 512 KB to 1024 KB of flash memory. This allows emulating 1 to 3 small floppy disks (using the 8” SSSD format as reference, which is 251 KB each). In other words, a bare F407 chip could emulate a CP/M system, including one or more (virtual) floppy disks for permanent data storage.

But this is not (yet?) about soldering SMD chips - let’s look at some ready-made boards.


One of the lowest-cost F407 boards on eBay is the “DIY MORE” board with 100-pin F407:

Note the typo in the name, English is no doubt as hard for someone from China to read and understand, as Chinese is for the rest of the world! Here is the (labeled) back side:

This board is as minimal as it gets: there are 8 MHz and 32768 Hz crystals, RESET and USER (PD15) buttons, a power LED and a user LED (PE0), and a micro-USB jack. There’s neither a JTAG / SWD connector, nor a USART header - even though these I/O pins are present, they have not been broken out as separate connectors.

The DIYMORE F407 board has the “VG” variant F407, i.e. 100-pin and with 1024 KB flash built-in. Which is nice, most low-end F407 boards are “VE” and only have 512 KB flash.

The Black F407VE

Another slightly larger board, and now in fact my favourite step up from the Blue Pill, is the “Black F407” (that’s not an official name, but what the STM32duino wiki page calls it):

This board includes a lot of interesting and useful add-ons:

The flash memory chip and especially the SD card socket will be very handy for storing a virtually unlimited number of virtual floppy- and hard-disk images.

The JTAG connector is a standard 2x10 pin sideways header, which I hardly ever use. Instead, I’ve hacked together a custom “converter plug” for my preferred 6-pin hookup, with (from left to right): GND, SWD CLK/DIO, USART RX/TX, and +3.3V.

It may not be the prettiest, but it works splendidly.

Uploads over USB

A big advantage of the F407 over the F103, is that it supports Device Firmware Upgrades (DFU) over USB. This means that for simple first-use installation, no special programmer, Black Magic Probe, or other SWD / JTAG / serial upload tool is needed. You just need to put the board into boot mode via the two red jumpers shown above, and use the open-source dfu-util tool to upload a firmware image to the F407.

That’s perfect for novice use and field updates - but for development, an SWD + serial link is more effective. Hence my cobbled-together hack in the picture above.

Another great use for the USB port, is to supply power and connect to a serial-over-USB console for retro use. This requires a driver for the F407’s built-in USB hardware.