Skip to content

Board: Bluepill

Jose Alamos edited this page Aug 9, 2018 · 6 revisions

WARNING: This entry will be deprecated. All content has been moved to


The bluepill is an STM32F103 based board which can be bought for around 2€ on sides like AliExpress, eBay and others. Although the STM32F130C8 MCU nominally has 64 KB flash, most actually have 128 KB flash.



Family ARM Cortex-M3
Vendor STMicroelectronics
Flash 64 KB / 128 KB
Frequency up to 72 MHz
Timer 3x 16-Bit
ADC 2x 12-bit, 10 channels
I2C 2
Vcc 2.0 to 3.6 V
Datasheet Datasheet

Implementation Status

ID Supported
GPIO yes
PWM yes
UART yes
ADC yes
I2C no
SPI yes
USB no
Timer yes
CAN no


To program and debug the board you need a SWD capable debugger. The easiest way is using OpenOCD. If you have OpenOCD installed, you can flash the device with:

$ make BOARD=bluepill flash

Additional Flash

To make use of the entire 128 KB flash, compile your application with:

$ make BOARD=bluepill CPU_MODEL=stm32f103cb

This sets the CPU_MODEL make variable to stm32f103cb, the default value is stm32f103c8. These two CPU models basically only have one major difference, the latter has 128 KB flash while the former has 64 KB.

If you want to flash a binary compiled this way you either need to figure out how to adjust the OpenOCD configuration to make it use 128 KB flash or use this stlink fork which has a patch to make use of the entire 128 KB flash using:

$ C8T6HACK=1 st-flash write /dev/sgX $pathToHexFile 0x8000000

Connecting via Serial

The default UART port used is UART2, which uses pins A2 (TX) and A3 (RX).

Using PWM

PWM is available at pins A8 to A11.

Known Issues

USB connector

The Micro-USB port is sometimes not soldered properly. Also, it is usually equipped with an incorrect resistor. This can be fixed multiple ways.

Flashing abortion

Some boards have problems to flash on the first try. It may help, to press the reset-button, start the flashing and release it while doing so.

Where to buy

The board is sold under different names. On some sites it is called bluepill or blue pill. On others you might find it by searching for stm32f103c8 or stm32f103c8t6.

Try eBay or AliExpress.

Further reading

Clone this wiki locally
You can’t perform that action at this time.