Skip to content
Ahsan’s Lab logoAhsan Suny.

Programming the STM32 Blue Pill with the Arduino IDE

Date: 20 January 2021  |  Estimated reading time: 1 min  |  Author: Ahsan Suny

Table of contents

The STM32 Blue Pill is a feature-rich development board based on the STM32F103C8T6, a 32-bit ARM Cortex-M3 processor running at 72 MHz. Unlike a common Arduino board, which is easy to use, programming the Blue Pill can be confusing, especially for a new user.

There are several ways to program it from the Arduino IDE. Some need extra hardware; others need only a USB cable.

Three common upload methods#

  1. Arduino HID bootloader. Flash a USB bootloader once, then upload sketches over the board's own USB port, like a normal Arduino.
  2. ST-Link compatible programmer. The most reliable option. It uses the SWD pins and also lets you debug.
  3. USB to 3.3 V TTL serial adapter. Uses the chip's built-in serial bootloader. Set the BOOT0 jumper to 1 before uploading.

Before any of these, install the STM32 board package. See Setting up Arduino IDE for ESP8266, ESP32 and STM32.

Flashing tool#

To flash a bootloader or a binary directly, use ST's official STM32CubeProgrammer.

References#

Cited as:

Ahsan, MD Shahnauze. (Jan 2021). Programming the STM32 Blue Pill with the Arduino IDE. Ahsan Suny’s blog. https://info.ahsansuny.com/blog/programming-stm32-blue-pill-arduino/

Or

@misc{ahsan2021programmingstm32,
  title        = "Programming the STM32 Blue Pill with the Arduino IDE",
  author       = "MD Shahnauze Ahsan",
  howpublished = "Ahsan Suny's blog",
  year         = "2021",
  url          = "https://info.ahsansuny.com/blog/programming-stm32-blue-pill-arduino/"
}

All 2 parts of Technical notes →