Blue Pill

From STM32duino wiki
Jump to: navigation, search
STM32 Blue Pill perspective.jpg
Level of support Good
Bootloader Flash with [1]
Microcontroller STM32F103C8
Flash 64 KB/128 KB
RAM 20 KB
Clock Speed 72 MHz
USB connector Micro-B (varying quality)
User LED(s) PC13 (blue; lights when PC13 is LOW)
User button(s) None
RTC Crystal Yes
ST-Link header Yes
Voltage regulator RT9193-33 (300 mA)
Schematic media:Vcc-gnd.com-STM32F103C8-schematic.pdf (4.7k R10)
media:Stm32f103c8t6_schematic.png (10k R10)
Manufacturer data http://vcc-gnd.com/read.php?tid=369&fid=6
Pinout media:Bluepillpinout.gif

http://reblag.dk/wordpress/wp-content/uploads/2016/07/The-Generic-STM32F103-Pinout-Diagram.pdf

Dimensions 53.0mm x 22.5mm

Overview

Blue pill is the nickname given to the most popular, ultra-cheap and compact STM32F103 board.

It has better availability than the Red Pill and has been around longer than the Black Pill. See also the very similar RobotDyn Black Pill.

Hardware installation

BluePillUsbResistor.jpg

The USB standard requires a 1.5 kΩ pullup resistor on D+, but this board is known to have a wrong value (R10 on the board). It ships with either a 10 kΩ resistor or a 4.7 kΩ resistor, but it should be replaced with a 1.5 kΩ resistor, or put an appropriate resistor value (e.g 1.8 kΩ) in between PA12 and 3.3V. It is also true that some PCs are tolerant of incorrect value so, before you change the resistance, you can try if it works in your case.


Software installation

A bootloader needs to be flashed using USB to Serial or ST-Link (SWD). See Flashing the bootloader

Follow the normal Installation guide.

Note that after first flashing the bootloader you may have to place the board into "perpetual bootloader" mode before you can upload a sketch; place a resistor between pin PC14 and 3.3V, and then reset the board. You should now be able to flash a blank sketch, remove the resistor, and restart the board, after which uploading new sketches should work as expected. If you find that the IDE successfully resets your board, but dfu-util complains about no DFU-devices being present you may have to edit the maple-upload script in tools-folder. Find the line where it calls upload-reset, and increase the value given to it.


Where to buy

eBay, AliExpress, etc.

128 KB flash on C8 version

The F103C8 ST microcontroller is declared to have 64 KB of flash, but virtually all the C8 microcontrollers tested have 128 KB of flash instead.

At least one exception was reported in the forum, so it is not guaranteed [[2]].

The STM32duino core have two uploading board settings, one for 64 KB and one for 128 KB. Also the integrated serial bootloader communicates at startup that are present 128 KB of flash.

- Bootloader message:

  • Using Parser : Raw BINARY
  • Interface serial_w32: 57600 8E1
  • Version  : 0x22
  • Option 1  : 0x00
  • Option 2  : 0x00
  • Device ID  : 0x0410 (Medium-density)
  • - RAM  : 20 KiB (512b reserved by bootloader)
  • - Flash  : 128 KiB (sector size: 4x1024)
  • - Option RAM : 16 b
  • - System RAM : 2 KiB

Additional notes

The name on the forum for these boards is a reference to the Matrix and comes from this thread on the forum. It's one of the cheap STM32F103 boards that can be found from Chinese retailers. It's currently very popular with retailers, and it costs about $2.

Features

  • ARM Cortex M3
  • 72 MHz
  • 64 KB/128 KB Flash
  • 20 KB RAM
  • Reset button
  • LED on PIN PC13
  • 32 kHz Real time clock crystal
  • Jump links on Boot0 and Boot1
  • Micro USB connector for power and data
  • ST-Link header on the top of the board.


Known issues

  • The micro-USB connector is not soldered to the board very well and is easily broken.

There are multiple versions of this board with different connectors. Refer to the pictures for examples. You can increase the strength by re-soldering the connector and possibly covering the connector in epoxy glue or hot-melt glue.

  • The 3.3V voltage regulator is a very small, knock-off device. It overheats quickly and often has no thermal protection, feeding through its input voltage when it fails.

It's recommended to power external components with another regulator so that the power draw on the Blue Pill does not exceed 100 mA.

  • Analogue power and ground is connected directly to digital power and ground, which can cause additional noise on the ADC input.
  • The reset button on some of these boards is very hard to press.
  • There is no dedicated USB reset circuitry on this board.
  • There is no Schottky diode between USB +5V and system VIN power. So you cannot power the board directly from a 5 Volt supply, and use USB at the same time.
  • Most bluepill boards have the wrong pullup resistor value which prevents native USB from working properly. The R10 resistor should have a value of 1k5 and be pulled up to 3v3. In spite of this flaw, native USB will work on some PCs. Try the board on your PC before you bother changing the resistor.

Other images

STM32 Blue Pill top.jpg

STM32 Blue Pill bottom.jpg


Blue pill features photo.jpg

Blue pill top photo.jpg

Blue pill bottom photo.jpg

Bluepillpinout.gif

STM32 BP Alt Top View.jpg