🛠 CAN sur Blue Pill : le contrôleur bxCAN à moins de 5 euros
The Blue Pill's differentiating argument
Apart from the price, it is the CAN controller that made this board successful in robotics and industrial tinkering: the official Arduino core variant exposes CAN1 in its pinout table (PeripheralPins.c), and the F103 is one of the few affordable Cortex-M3 chips to embed a bxCAN controller. Add three USARTs (configurable as RS-485), two I2Cs, and two SPIs, and the little blue pill becomes a cheap serial/CAN gateway.
The minimum setup
The chip only handles the controller part: you need an external physical transceiver (such as the TJA1050 or MCP2551, common 5 V modules — power it with 5 V but be careful with logic levels, as the board is 3.3 V; many modern modules like the TJA1050 tolerate 3.3 V on the logic side, check the module's datasheet).
On the software side, there are three documented paths: the Cube HAL (CAN peripheral), libopencm3 (CAN API for F1), or direct register access as described in the RM0008 reference manual (CD00171194 on st.com).
The field test that validates everything
Two Blue Pills facing each other, a CAN frame sent back and forth with timestamps, for one hour: this setup detects most counterfeits, because the Greaseweazle wiki lists chips sold as STM32F103C8 where the DMA generates spurious end-of-transfer interrupts and locks up — exactly the kind of failure that only manifests under real load. Clones sometimes won't even start from the System Bootloader, which complicates recovery in the workshop.
Deployment: the rules of the game
- Never rely on the marked density: boards sold as C8T6 often contain CB 128 KB chips… or clones ("64KB Flash (most have 128KB)", land-boards).
- GigaDevice's GD32F103 are legitimate pin-compatible alternatives (Cortex-M3 line introduced in 2013) — if a batch of ST clones lets you down, a well-sourced batch of GD32s is sometimes more reliable.
- For a product (vehicle, machine), a counterfeit F103 has no place: source your chips from an authorized distributor, using the blue development board for prototyping.
- Always plan for SWD access on the final board: it's your anti-brick insurance when the firmware goes wrong.
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
- Série, ADC et chasse aux contrefaçons : diagnostiquer sa Blue Pill
- 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