🛠 CAN sur Blue Pill : le contrôleur bxCAN à moins de 5 euros

STM32F103 "Blue Pill" (STM32F103C8T6) · avance · Le F103 embarque un contrôleur CAN (bxCAN) rarissime à ce prix. Montage, bases logicielles et mises en garde avant de l'installer dans un vrai véhicule.

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

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials