🛠 Passer au niveau supérieur : STM32CubeIDE, HAL et LL sur F103

STM32F103 "Blue Pill" (STM32F103C8T6) · intermediaire · Quitter l'abstraction Arduino pour la chaîne officielle ST : CubeMX, HAL/LL, CubeProgrammer, et ce que dit vraiment le silicium (ni FPU, ni MPU).

Why leave (a little) Arduino

The Arduino core stm32duino is itself built on top of STM32Cube HAL/LL + CMSIS + GNU Arm GCC. Working directly within the ST toolchain gives you control over the clock tree, DMA routing, interrupts, and power consumption — while keeping the graphical code generation of STM32CubeMX and the embedded IDE STM32CubeIDE. For flashing: STM32CubeProgrammer (CLI STM32_Programmer_CLI or GUI), which communicates via SWD with the board's 4-pin connector.

Context note: ST's legacy Standard Peripheral Library (SPL) is documented as deprecated — tutorials still using it should be considered historical; the SPL has been replaced by Cube HAL/LL.

Configuring the Blue Pill project in CubeMX

  1. Select the part number STM32F103C8T6 (LQFP48, 64 KB flash / 20 KB SRAM).
  2. Clocks: the board's crystal is an HSE 8 MHz (plus an LSE 32.768 kHz for the RTC); the PLL boosts it to 72 MHz, the maximum frequency for the F103 line as stated on the ST product page.
  3. Enable SWD in Serial Wire mode (PA13/PA14) from the start, otherwise subsequent debugging will end up requiring a forced re-flash via the ROM serial bootloader.
  4. The flash page size is 1 KB (for densities up to 128 KB) — important for EEPROM emulation and write management.

What the silicon says (CMSIS)

The ST device header stm32f103xb.h (cmsis_device_f1 repository) defines the physical limits: Cortex-M3 r2p0 single-core, no FPU (the M3 does not have one), __MPU_PRESENT 0 (no MPU), 4 bits of NVIC priority. In other words: no hardware floating-point (emulated in software, CPU cost), no memory isolation, no encryption engine — the F103's strengths are price and peripherals (CAN, 3 USARTs, 2 SPIs, 2 I2Cs, 2 12-bit ADCs, 7-channel DMA), not security.

The right documentation habit

The Reference Manual RM0008 (CD00171194 on st.com) is the source of truth for registers, boot modes, and the ROM bootloader; the datasheet cd00161566.pdf details the electrical characteristics. Both are official ST PDFs — in case of contradiction between a blog post and these documents, the latter prevail.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials