Simulator

STM32 simulator, running in this tab

Mokxi is a free STM32 simulator that runs in your browser, with nothing to install and no account needed. Mokxi models the STM32F411 on the WeAct "Black Pill" and on ST’s Nucleo-F411RE, on our own Cortex-M4 core, 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
STM32: 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-M4 (ARMv7-M), no FPU, at 84 MHz, with the datasheet cycle count of every instruction.
PeripheralsGPIO on ports A to D with the real MODER, OTYPER, PUPDR and BSRR registers, TIM1 to TIM5 with glitch-free PWM, ADC1, USART1 and USART2, and SysTick with the real NVIC priority bits.
What is not there yetDMA, I2C, SPI and USB, and the clock tree: SYSCLK is fixed from power-on (84 MHz on the Black Pill, 100 MHz on the Nucleo) rather than brought up from HSI and the PLL.
Compared

Other STM32 simulators, honestly

STM32CubeIDE has no simulator of its own, so most people end up weighing these.

WokwiRuns the STM32C031, the STM32L031 and the F103 Blue Pill in the browser, with GDB.ProteusPaid Windows software whose VSM runs firmware against SPICE-based analog simulation, with PCB design.
Renode and QEMUFree, open-source emulators that run Cortex-M firmware on your computer, without a breadboard or parts around the chip.

Every simulator compared, side by side

Go further

The full board page

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

STM32F411 simulatorBlink, a button and the serial monitor, running.
Guides

Step-by-step guides for the STM32

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 STM32F411CEU6, on the WeAct "Black Pill" v3.x.

Will my firmware run on a real Black Pill?

Yes, as long as it does not reach for DMA, I2C, SPI or USB.

Does it run the STM32Cube HAL?

No. The firmware runtime here is ours, not the vendor HAL, libopencm3 or the STM32duino core. HAL start-up code programs the clock tree and flash wait states, which are not modeled. Write to the registers directly, or use the Arduino calls the runtime provides.

Which STM32 boards can I simulate?

Three: the STM32F411 Black Pill on a Cortex-M4 at 84 MHz, ST’s Nucleo-F411RE with the same chip at 100 MHz and Uno headers, and the STM32F103 Blue Pill on a Cortex-M3 at 72 MHz. Each has its own page.

Can I learn STM32 registers here?

Yes, and it is what these boards are best at. Every peripheral starts with its clock off, as on the chip, so enabling it in RCC is part of the exercise, and a write to a peripheral that is not modeled stops with a bus fault rather than passing silently.

Can I wire sensors and displays to it?

Yes. The Wire and SPI libraries drive the bus from the pins, so I2C and SPI parts work, and the breadboard, the scope and the logic analyzer are on the same canvas.

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 STM32

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