🛠 Série, ADC et chasse aux contrefaçons : diagnostiquer sa Blue Pill

STM32F103 "Blue Pill" (STM32F103C8T6) · intermediaire · Exploiter USART1 et les ADC 12 bits, puis vérifier si la puce est un vrai STM32 ou un clone grâce au test Blinky de Greaseweazle.

The useful serial port: USART1

On the Blue Pill, the micro-USB connector is not connected to any USB-to-serial converter: Serial (USB) does not exist without a USB stack. The simplest path is USART1 on PA9 (TX) / PA10 (RX), the same port used by the ROM bootloader. A 3.3 V FTDI adapter connected to it provides a free 115200 8n1 console. The F103 features three USARTs (USART1–USART3), two SPIs, two I2Cs, and a CAN controller, according to the pinout table of the official Arduino core variant.

The 12-bit ADCs (and the lack of a DAC)

The chip embeds ADC1 + ADC2, two 12-bit converters (inputs PA0..PA7 among others), controlled on the Arduino side via analogRead; the official variant explicitly states “No DAC”: for analog output, you will need a PWM + RC filter or an external circuit (such as an MCP4725 on I2C). The F103 also has a 7-channel DMA controller and 7 timers (as claimed by the land-boards wiki).

Is your chip genuine?

Wikipedia is categorical: “unfortunately, most blue pill boards now contain a fake Chinese STM32”. The Greaseweazle wiki maintains a “Rogues' Gallery” of counterfeits sold as STM32F103C8, with very concrete failure signatures:

The Greaseweazle project provides a “Blinky” diagnostic firmware that runs on Blue Pill-class boards and sorts things out in a few seconds.

Why it matters

A legitimate GD32F103 clone (GigaDevice, Cortex-M3 line introduced in 2013) will often work well; a counterfeit marked ST will behave poorly at the margins (high baud rates, DMA, configuration domains). Test each new board before integrating it into a project, and keep 115200 as the default serial baud rate.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials