Support for the stm32f103c8 based bluepill board. More...
Support for the stm32f103c8 based bluepill board.
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.
|Flash||64 KB / 128 KB|
|Frequency||up to 72 MHz|
|ADC||2x 12-bit, 10 channels|
|Vcc||2.0 to 3.6 V|
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
To make use of the entire 128 KB flash, compile your application with:
$ make STM32F103C8_FLASH_HACK=1 BOARD=bluepill
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. You may also set
STM32F103C8_FLASH_HACK as environment variable.
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
The default UART port used is UART2, which uses pins A2 (TX) and A3 (RX). To use it, configure your UART to operate at a baudrate of 115200/8N1.
PWM is available at pins A8 to A11.
The Micro-USB port is sometimes not soldered properly. Also, it is usually equipped with an incorrect resistor. This can be fixed multiple ways.
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.
The board is sold under different names. On some sites it is called
blue pill. On others you might find it by searching for
http://wiki.stm32duino.com/index.php?title=Blue_Pill http://wiki.stm32duino.com/index.php?title=Maple_Mini#Clones http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit- arm-cortex-mcus/stm32-mainstream-mcus/stm32f1-series/stm32f103/stm32f103c8.html
|This board can be bought very cheaply on sides like eBay or AliExpress. |