STM32 Blue Pill (F103CB) Blink is a runnable microcontroller simulation example on SensBench — open the wired circuit, inspect the code, and compile real firmware in your browser, no install needed. Last updated Aug 14, 2026.

FREE SIMULATOR EXAMPLE · BEGINNER

STM32 Blue Pill (F103CB) Blink

This example blinks the STM32F103CB Blue Pill’s onboard PC13 LED and prints a board banner to Serial. The CB variant adds 128 KB flash over the common C8, but the blink is identical — the fastest way to verify an F103CB toolchain.

Board STM32 Blue Pill (STM32F103CB, Cortex-M3, 72 MHz)
Difficulty beginner
Category basics
Libraries None — just the Arduino core
Runs in Sensbench browser simulator — free, no account
STM32 Blue Pill F103CB blinking its onboard PC13 LED under QEMU emulation in the Sensbench simulator

The exact circuit you get when you open this example — already wired, ready to run.

The sketch

// STM32 Blue Pill (STM32F103CB, 128KB flash) — onboard LED on PC13 (active LOW).

void setup() {
  pinMode(PC13, OUTPUT);
  Serial.begin(115200);
  Serial.println("SENSBENCH STM32 F103CB Blue Pill");
}

void loop() {
  digitalWrite(PC13, LOW);   // LED on
  delay(200);
  digitalWrite(PC13, HIGH);  // LED off
  delay(200);
}

How it works

pinMode(PC13, OUTPUT) and the loop writes LOW (LED on) and HIGH (off) at 200 ms intervals. The active-LOW polarity is the entire trick: the sketch is otherwise the universal blink pattern that runs on every Arduino-family board.

The Serial.println() banner names the board at 115200 baud. Under QEMU the emulated F103CB executes real Cortex-M3 instructions with real timing, so the 200 ms delay produces an honest 2.5 Hz blink — the same cadence a physical board would show.

Before you build it for real

The F103CB is 3.3 V logic with 5 V-tolerant inputs on most GPIOs — but tolerance does not extend to power: feeding 5 V into a pin configured as output can still damage it. The active-LOW PC13 LED is the polarity trap that turns every newcomer’s first sketch into a dark board. Under QEMU, the emulator models the core but not silicon quirks like I/O port clock gating — on real hardware, forgetting RCC clock enable for the GPIO port is a common first STM32 failure that no emulation here reproduces, so your physical bring-up may still need HAL-level care.

Related examples

FAQ

What does the CB suffix mean?

In STM32 naming, the last letter/number encode flash size: CB means 128 KB flash (vs 64 KB on the common C8). The F103CB is otherwise pin-compatible and code-compatible with the C8 — a blink sketch cannot tell them apart. The 128 KB matters when you grow into libraries and bootloaders.

Why write LOW to turn the LED on?

The Blue Pill’s PCB pulls the LED from 3.3 V through a resistor to PC13 — the pin sinks current to light it. So LOW = on, HIGH = off. Every STM32 example in this family shows the same polarity; it is only surprising when you arrive from AVR boards.