Simulator

Blue Pill simulator, running in this tab

Mokxi is a free STM32 Blue Pill simulator that runs in your browser, with nothing to install and no account needed. Mokxi models the STM32F103 on the "Blue Pill", on our own Cortex-M3 core at 72 MHz, on the real memory map, so a build that runs here runs on the board on your desk.

  • 505parts on the bench
  • 45boards running now
  • 1.00xreal time, on every board
Blue Pill: blinklive0.000 s 0.00x
Click to open it in the editor
Real firmware, running right now on our own core. Click it to open the circuit in the editor.
What is modeled

The numbers, not the marketing

Taken from the board's own contract document and put in plain words.

The coreCortex-M3 (ARMv7-M), no DSP extension and no FPU, at 72 MHz, with the datasheet cycle count of every instruction.
PeripheralsGPIO on ports A to C through the F1’s own CRL and CRH registers, TIM1 to TIM4 with glitch-free PWM, USART1, a twelve-bit ADC on ten pins, and SysTick with the real NVIC priority bits.
What is not there yetDMA, USB, CAN, I2C and SPI, and the clock tree: SYSCLK is fixed at 72 MHz from power-on rather than brought up from HSE and the PLL.
Go further

The full board page

Every peripheral area, every example and the wiring notes, in one place.

STM32 Blue Pill simulatorBlink, a button and the serial monitor, running.
Guides

Step-by-step guides for the Blue Pill

Each one has the parts, the wiring and the code, and ends in a circuit you can run.

How it works

Three steps from a blank tab to a running circuit.

  1. Open the editor

    It runs in your browser tab. Nothing to install, and you need no account to start.

    Your first project
  2. Wire it and write the code

    Drag parts onto a breadboard, run each wire from pin to pin, and write the sketch beside it.

    Wiring
  3. Press Run

    Your sketch compiles in the tab and runs on a model of the chip, with the Serial Monitor beside it.

    Run and serial
Reviews

What makers say about Mokxi.

“The AI checker helps check and correct my circuits, and it has way more components than Tinkercad. As a student I really appreciate the tool.”

ChloeEngineering student

“I’d been looking for a real online electronic simulator that was intuitive and complete when I found Mokxi. I was able to quickly import a Fritzing file and my Arduino sketch and start testing. Mokxi has all of the makings for the best online Arduino simulator I have been able to find!”

JayModel builderFeatured in his DioramaOS post

“I’m using Mokxi to develop and simulate an STM32-based four-wheel-drive robot car before building the actual hardware. It allows me to experiment with DC motor control, PWM, RPM measurement using photointerrupters, and different acceleration, braking, and reversing strategies, helping me understand and refine the system before implementing it in real life.”

NusretRobot car builder, Hamburg

Share your story

FAQ

Questions, answered.

Which STM32 does this simulate?

The STM32F103C8T6, on the board everybody calls the Blue Pill.

Can I program it like in the Arduino IDE?

Yes, in Arduino-style C++: Blink, Button, Fade and Serial are its examples, and Servo, Wire, SPI, LiquidCrystal_I2C, the SSD1306 OLED and DHT headers compile as they stand. It runs on Mokxi’s own runtime, not the STM32duino core, and Wire.begin() puts I2C on PB7 and PB6.

Is this the same as the Black Pill?

No. That is an STM32F411, a Cortex-M4 at 84 MHz with a completely different register map. The F103 configures a pin with one four-bit field, takes an input pull out of ODR, and has an ADC.

Why can my sketch not use PA15, PB3 or PB4?

The debug port holds them out of reset. Write AFIO->MAPR = AFIO_MAPR_SWJ_SW_ONLY in setup() and they are yours, exactly as on the chip.

Is it free?

Yes, with no card and no account needed to try it.

Simulators for one kind of circuit

A servo, a display, a motor driver or a rectifier, each already running.

Try your own firmware on the Blue Pill

What you build here runs on the board on your desk, unchanged. Nothing to install and no account needed.