🛠 Premier programme Arduino sur la Blue Pill (core officiel stm32duino)

STM32F103 "Blue Pill" (STM32F103C8T6) · debutant · Installer le core STM32 officiel, sélectionner BluePill F103C8 et faire clignoter la LED PC13 en tenant compte de sa logique inversée.

Why the official core?

The Blue Pill is first-class supported by stm32duino/Arduino_Core_STM32, the Arduino core maintained by ST, based on STM32Cube HAL/LL, CMSIS, and the GNU Arm GCC compiler. The BLUEPILL_F103C8 target has been supported since core version 1.2.0. Note: since core release 2.8.0, only Arduino IDE 2 is supported. There is also a historical community core (rogerclarkmelbourne/Arduino_STM32, derived from libmaple, for Arduino IDE 1.8.x), but for getting started in 2026, the official core is recommended.

Step-by-step installation

  1. Open Arduino IDE 2, go to the Board Manager, and add the URL: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json.
  2. Install “STM32F1 boards”.
  3. Select the board Generic STM32F1 series → BluePill F103C8.

The blink, Blue Pill version

The user LED is on PC13, in sink mode: LOW = on. The code below therefore blinks “in reverse” compared to a classic Arduino, and this is normal:

#include <Arduino.h>

void setup {
  pinMode(PC_13, OUTPUT);
  digitalWrite(PC_13, HIGH);   // LED ÉTEINTE (câblée au VCC)
  Serial1.begin(115200);       // USART1 : PA9=TX, PA10=RX
  analogRead(PA_0);            // ADC1_IN0, 12 bits sur F103
}

void loop {
  digitalWrite(PC_13, LOW);    // LED ALLUMÉE (logique active-basse)
  delay(250);
  digitalWrite(PC_13, HIGH);   // LED ÉTEINTE
  delay(750);
  Serial1.printf("ADC PA0=%u\r\n", analogRead(PA_0));
}

What this program does

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials