This is an old revision of the document!
Table of Contents
STM32 "Blue Pill"
Some quick notes about setting up a STM32F103C8T6 "Blue Pill" for development on Arduino.1)
Setup
Arduino environment
Do once:
- Under Files > Preferences, add to the “Additional Boards Manager URLs:” field:
http://dan.drown.org/stm32duino/package_STM32duino_index.json
- Under Tools > Board > Boards Manager …, find “STM32F1xxx/GD32F1xxx boards by stm32duino” and install it.
Hardware
In addition to your “Blue Pill,” you will also need a 3.3V USB to serial converter. I used a SparkFun Serial Basic configured for 3.3V. Only the power, TX and RX pins will be used, so you should be able to use a standard FTDI board as well. (You probably don't have to power it from the board either.)
Lots of pins on the STM32F103C8T6 are purported to be 5V tolerant, but the main DC isn't! I don't know if TX/RX are.
There is a 5V input on the board and a USB connector that can power the board. These are purported to go through a small 3.3V regulator.
- Connect VCC and ground from the serial converter board to the
3.3
andGND
pins of the Blue Pill. - Connect the serial converter's RX to the Blue Pill's
A9
and TX toA10
.
Project config
Under the Tools menu, make the following selections:
- Board : “Generic STM32F103C series”
- Variant : “STM32F103C8 (20k RAM. 64k Flash”
- Upload method : “Serial”
- Optimize : “Smallest (default)”
- Port : wherever the serial converter is plugged into
Programming
- Move the top jumper to the 1 (right) position.
- Push reset.
- Upload the sketch.
- To re-upload, push reset and upload.
To put the device into “use” mode, move the top jumper back to 0 (left) position.