STM32 Blue Pill simulator, F103 and all
Mokxi models the STM32 "Blue Pill" on our own Cortex-M3 core, running the STM32F103 at 72 MHz. GPIO through the F1’s own CRL and CRH registers, TIM1 to TIM4, USART1, a twelve-bit ADC and SysTick use their real addresses. Test finished firmware on the physical board too.
- 8peripheral areas modeled
- 3projects ready to run
- Real timeon your own machine
What is modeled
Taken from the board's own contract document and put in plain words, with what is missing listed underneath.
Not in the model
- DMA, USB, CAN, I2C and SPI. Their registers are unmapped, so touching one is a fault rather than a silent zero.
- The clock tree. SYSCLK is fixed at 72 MHz from power-on rather than brought up from HSI, HSE and the PLL.
- The RTC, the backup registers and the watchdogs.
- Vendor binaries: the STM32Cube HAL, libopencm3 and the STM32duino core. The firmware runtime here is ours.
Open one and press Run
Each of these opens in the editor exactly as it is drawn here.
Every built-in project on the Blue Pill
Each has its own page with the circuit running, the code and a parts list.
Arduino libraries that compile as they are
Paste a tutorial that includes one of these and it builds: each is written for Mokxi, on its own drivers, under the name the tutorials use. For any other library the build names the Mokxi header that does the same job.
Tutorials that use this board
Each one ends in a running circuit, on this same board.
Questions
Is it free?
Yes. Every board and every part is on the free plan, with no account needed.
Which STM32?
The STM32F103C8T6 in its 48-pin package, on the board everybody calls the Blue Pill.
How is this different from the Black Pill?
A different generation. The F103 is a Cortex-M3 at 72 MHz with 64 KB of flash, it configures a pin with one four-bit field in CRL or CRH rather than four registers, it takes an input’s pull direction out of ODR, and it has an ADC. Not one peripheral address is shared with the F411.
Why will my sketch not drive PA15, PB3 or PB4?
The debug port holds them out of reset. Write AFIO->MAPR = AFIO_MAPR_SWJ_SW_ONLY once in setup() and they are yours. The model does this exactly as the chip does.
Will my firmware run on a real Blue Pill?
Yes, as long as it does not reach for DMA, USB, CAN, I2C or SPI. The memory map and the register offsets are the real ones.
The other boards
Every one of these runs today, and every one is free.
Looking for the shorter introduction? See the Blue Pill simulator page.
Try it on your own firmware
What you build here runs on the board on your desk, unchanged. Nothing to install and no account needed.