🛠 Série, ADC et chasse aux contrefaçons : diagnostiquer sa Blue Pill
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:
- programming is impossible at 921600 baud (but 115200 works);
- it is impossible to start firmware from the System Bootloader;
- I2C refuses to accept CR1_ACK in the same write as CR1_PE;
- the DMA generates spurious end-of-transfer interrupts and hangs;
- cutting the clock of the backup domain crashes the chip;
- some clones fix Erratum 2.3 of genuine chips (reading debug registers) — which itself becomes a detection trick.
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
- Découvrir la Blue Pill : que trouve-t-on dans la boîte ?
- Premier programme Arduino sur la Blue Pill (core officiel stm32duino)
- Alimenter et flasher la Blue Pill : BOOT0, port série, ST-Link et DFU
- Dompter l'USB natif de la Blue Pill : CDC, DFU et la résistance rebelle
- Passer au niveau supérieur : STM32CubeIDE, HAL et LL sur F103
- Firmware libre sur Blue Pill avec libopencm3 et OpenOCD