Board

STM32F411 Black Pill simulator

Mokxi models the WeAct "Black Pill" on our own Cortex-M4 core, running the STM32F411 at 84 MHz. GPIO, TIM1 through TIM5, the ADC, USART1, SysTick and the NVIC use their real addresses. Test finished firmware on the physical board too.

Start building free
  • 8peripheral areas modeled
  • 3projects ready to run
  • Real timeon your own machine
STM32F411 Black Pill: blinklive0.000 s 0.00x
Click to open it in the editor
The board is running real firmware right now. Click it to open the circuit in the editor.
The model

What is modeled

Taken from the board's own contract document and put in plain words, with what is missing beside it.

Modeled

Core
Cortex-M4 (ARMv7-M), no FPU, with the datasheet cycle count of every instruction
GPIO
Ports A to D, with the real MODER, OTYPER, PUPDR and BSRR registers at their real addresses
TIM1 to TIM5
Up, down and center-aligned counting, with glitch-free PWM through ARPE and OCxPE
ADC1
Twelve bits on PA0 to PA7, PB0 and PB1, read through analogRead in STM32duino’s ten by default
USART1
Paced at the configured baud rate, wired to the serial monitor
SysTick and the NVIC
The real priority bits and interrupt lines, so a handler runs the way the datasheet says
Sleep
WFI parks the core between events, so an idle sketch costs almost nothing to simulate
Memory map
The real STM32F411 addresses for everything above, so a build is not Mokxi-specific

Not modeled

  • DMA, I2C and SPI. Their registers are unmapped, so touching one is a fault rather than a silent zero.
  • USB. PA11 and PA12 are plain GPIO here.
  • The clock tree. SYSCLK is fixed at 84 MHz from power-on rather than brought up from HSI and the PLL.
  • Vendor binaries: the STM32Cube HAL, libopencm3 and the STM32duino core. The firmware runtime here is ours.
Start here

Open one and press Run

Each of these opens in the editor exactly as it is drawn here.

Projects

Every built-in project on the STM32

Each has its own page with the circuit running, the code and a parts list.

Libraries

Arduino libraries that compile as they are

Paste a tutorial that includes one of these and it builds. For any other library, the build names the Mokxi header that does the same job.

Servo.h
attach, write, writeMicroseconds, read, detach, on any pin
Wire.h
I2C as a master; Wire.begin() puts it on PB7 (SDA) and PB6 (SCL)
SPI.h
transfer and transactions, on the board’s usual SPI pins
EEPROM.h
read, write, update, get, put and EEPROM[i], kept in 4 KB of RAM, which a reset clears: this board has no EEPROM to write
LiquidCrystal_I2C.h
the 16x2 LCD behind its I2C backpack
Adafruit_GFX.h and Adafruit_SSD1306.h
the 128x64 I2C OLED: text, pixels, lines, rectangles, circles, triangles and bitmaps
DHT.h
the DHT11 and DHT22: temperature, humidity and the heat index, as floats you can print
OneWire.h and DallasTemperature.h
DS18B20 thermometers, any number on one pin, found by the 1-Wire search

And 14 more, 22 in all: Adafruit_BME280.h, Adafruit_BMP280.h and SparkFunBME280.h; RTClib.h; Adafruit_SHT31.h; Adafruit_PCF8591.h; Adafruit_ADXL345_U.h; LedControl.h; Adafruit_LEDBackpack.h; Adafruit_TCS34725.h; Adafruit_SGP30.h; Adafruit_INA219.h; Adafruit_ADS1X15.h; Adafruit_MCP23X17.h; Bounce2.h; HX711.h.

Learn

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 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 or SPI. The memory map and the register offsets are the real ones.

Do I need an account?

Only to save projects to the cloud and share them by link.

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.