Teams usually reach for STM32 when the hard part of the product isn't the radio or the app—it's the control. A pump has to hold pressure. A motor has to start smoothly under load. A sensor reading has to stay accurate next to a noisy power stage. A battery device has to sleep for months and still wake on time.
STM32 development services—in practice mostly STM32 firmware development—are about proving that kind of assumption on a real microcontroller: timers, ADCs, PWM, interrupts, field buses, low-power modes. The useful first question isn't "which chip is best?" but "which physical behavior has to work before we spend more?"
If your device mostly needs to sense something and send it over Wi-Fi or BLE, start with ESP32 development services. If it needs Linux, a camera, or a local dashboard, see Raspberry Pi development services.
What the first STM32 build should prove
Pick the assumption that would change your product decision if it failed. Typical candidates:
- A control loop runs at a fixed rate and keeps its timing while the firmware is also handling communication.
- ADC readings from the real sensor are stable and accurate enough once motors, relays, or switching supplies are running nearby.
- A motor or valve starts, stops, and reverses safely—including when a sensor disconnects mid-run.
- The device reaches its target sleep current and still wakes on the right event.
- Messages on a real CAN, RS-485, or Modbus bus are parsed reliably, not just in a bench loopback.
- After a brownout or watchdog reset, the firmware returns to a known safe state.
A focused demo usually means one development board, one control or measurement path, and only the I/O needed to exercise it. Add logging over a serial port and a pass/fail you can measure with an oscilloscope, logic analyzer, or power meter.
A useful brief reads like an acceptance test:
Sample the pressure sensor at 1 kHz, filter it, and drive the valve with PWM so the pressure stays within ±2% of the set point. If the sensor disconnects, close the valve within 50 ms and report the fault over UART.
Numbers like these turn "it seems to work" into something you can verify on a scope—and they stop a small experiment from turning into an open-ended firmware project.
STM32 vs ESP32 vs Raspberry Pi: which fits your demo?
All three can sit next to sensors and actuators, but they solve different problems. STM32 is a large family of Arm Cortex-M microcontrollers. ESP32 is a microcontroller with Wi-Fi and BLE on board. Raspberry Pi is a small Linux computer.
| Decision factor | STM32 | ESP32 | Raspberry Pi |
|---|---|---|---|
| Typical job | Deterministic control, motor and sensor loops, industrial interfaces | Connected sensor nodes, Wi-Fi/BLE devices | Gateways, cameras, local apps and dashboards |
| Timing | Hardware timers, interrupts, and DMA for tight, repeatable timing | Fine for many device loops; radio activity can add jitter | Not suited to hard real-time control |
| Analog and peripherals | Rich ADC and timer sets; CAN, USB, and advanced timers on many families | Usable ADC, less precise on some variants | No built-in ADC; needs add-on boards |
| Connectivity | Usually an external radio; STM32WB adds BLE, STM32WL adds LoRa/sub-GHz | Built-in Wi-Fi and/or BLE | Wi-Fi, Ethernet, full networking stack |
| Power | Dedicated low-power families for years-on-battery designs | Good deep sleep; Wi-Fi bursts are costly | Needs a steady supply |
| Tooling | STM32CubeIDE / CubeMX, HAL and LL drivers, FreeRTOS, Zephyr | ESP-IDF, Arduino | Linux, Python, containers |
Choose STM32 when timing, analog accuracy, motor control, field buses, or a strict power budget decide whether the product works. Choose ESP32 when the device mainly needs to talk to a network. Choose Raspberry Pi when you need Linux software, a camera pipeline, or a user interface on the device.
A split design—STM32 for control, ESP32 or Raspberry Pi for connectivity—is common in real products. For a first demo it only makes sense if both jobs are genuinely part of the question, because every extra board adds a protocol and another place to fail.
Choosing an STM32 family for a demo
ST sells well over a thousand STM32 part numbers. For a demo you only need to land in the right family; the exact part number can be optimized later for cost and availability.
| What the demo needs | Families to look at | Why |
|---|---|---|
| Simple, cost-sensitive control | STM32C0, STM32G0 | Small, inexpensive parts with enough timers and ADC channels for basic loops |
| Motor control or digital power | STM32G4 | Fast ADCs, advanced motor-control timers, math accelerators, and high-resolution timers on some parts |
| Battery-powered sensing | STM32L0, STM32L4, STM32U5 | Ultra-low-power modes and peripherals that keep working while the core sleeps |
| Heavier DSP, displays, more memory | STM32F4, STM32H7 | Higher clock speeds, DSP instructions, more RAM and flash |
| Bluetooth Low Energy on the same chip | STM32WB | Cortex-M4 application core plus a BLE radio |
| LoRa or sub-GHz radio | STM32WL | Integrated sub-GHz radio for long-range, low-data links |
Prototype on an official Nucleo or Discovery board for the chosen family. They include an on-board ST-LINK debugger, are cheap, and can be bought again when someone needs to reproduce your results. Be careful with no-name "Blue Pill" style boards for anything you plan to measure: many carry clone chips that don't behave exactly like the datasheet.
At demo stage, TinyBuild builds on off-the-shelf development boards with the hardware and materials you provide. Custom PCB design isn't part of that offering—it becomes relevant later, once the demo has answered the open question.
Firmware stack: HAL, LL, RTOS, or Zephyr
The stack should match the demo's risk and the team that will maintain it after handover.
- STM32CubeMX with HAL drivers — the fastest way to configure clocks and peripherals and get a demo running. Heavier than strictly necessary, which rarely matters at demo stage.
- LL drivers or direct register access — for the few code paths where timing or code size really is tight, such as an inner control loop.
- Bare-metal loop vs FreeRTOS — a simple main loop with interrupts is enough for one control path. An RTOS earns its place once several jobs with different timing (control, communication, display) have to coexist.
- Zephyr — worth it when you need portability across vendors or already have Zephyr code; expect more setup than CubeMX.
Debugging matters as much as the stack. SWD with an ST-LINK gives you breakpoints and live variables; an oscilloscope or logic analyzer proves timing; a serial log shows what the firmware thought was happening. A demo whose timing has never been measured hasn't proved timing.
How to scope the first demonstration
Build only the path that answers one product question, and make the event chain explicit: measure → compute → actuate → protect → report.
For each step, write down the inputs and ranges, the expected output, the timing budget, and what happens on a fault. Then decide how each will be checked: scope capture, current measurement, log file, or a repeated test run.
What usually waits until after the demo:
- custom PCB, enclosure, and connectors,
- certification such as CE or FCC,
- bootloader and secure firmware updates,
- production programming and test fixtures,
- a full user interface or mobile app.
For how a demo relates to a prototype and an MVP, see software development from idea to demo and MVP development for founders.
Cost drivers for an STM32 prototype
The chip is rarely the expensive part. Effort follows the behavior you need to prove and how carefully it has to be measured.
| Scope cue | Typical work involved |
|---|---|
| Small demonstration | One Nucleo board, one sensor or actuator, one control or measurement path, serial logging, setup notes |
| Medium demonstration | RTOS with several tasks, a field bus such as CAN or Modbus, low-power modes with measured current, a calibration routine |
| Complex demonstration | Field-oriented motor control, several boards, bootloader and update path, safety interlocks, tests across supply and temperature ranges |
What moves the estimate: how strict the timing and accuracy targets are, how many peripherals and buses are involved, how noisy the electrical environment is, whether power has to be measured, and whether the exact hardware is on the bench. Without the board, the peripherals, and clear acceptance numbers, any fixed timeline is a guess.
How TinyBuild handles a small STM32 demo
STM32 development services at TinyBuild start with a free consultation to pin down the physical behavior, the acceptance numbers, and whether STM32 is really the right platform.
- Define the behavior — what has to be measured, controlled, or protected, and how success will be checked.
- Pick family and board — or recommend ESP32 or Raspberry Pi if they fit better.
- Bring up the path — clocks, peripherals, and the one control or measurement loop that matters.
- Measure and break it — scope and current measurements, sensor unplugged, supply dips, resets.
- Hand over — source code, the CubeMX project file, flashing notes, measured results, known limits, and a continue / change / stop recommendation.
A development-board demo is evidence for a decision. It is not a production-ready or certified device.
Common failure points
- Clock and timer configuration — one wrong prescaler and every timing figure is off by a constant factor.
- Grounding and analog noise — ADC readings drift when sensor and motor share a return path.
- Inductive loads — motors and relays without a proper driver stage cause resets that look like firmware bugs.
- Watchdog and brownout settings — left at defaults, a glitch can leave the device stuck instead of safe.
- Interrupt priorities — a slow handler at the wrong priority silently breaks the control loop's timing.
- Regenerated CubeMX code — user code written outside the marked USER CODE sections gets overwritten.
- Handover gaps — no project file or flashing notes means nobody else can rebuild the firmware.
Test the normal path, then a reset, a disconnected sensor, and a supply dip. Logs should show which layer failed.
FAQ
Is STM32 or ESP32 better for a prototype?
It depends on what the prototype has to prove. STM32 is the stronger choice when precise timing, analog accuracy, motor control, field buses, or very low power are the risk. ESP32 is usually faster to a working demo when the main job is getting sensor data onto Wi-Fi or BLE.
Do I need an RTOS on STM32?
Not for a single control or measurement path—a main loop with interrupts is simpler and easier to verify. An RTOS such as FreeRTOS becomes useful when several tasks with different timing, like control, communication, and a display, have to run side by side.
Can an STM32 demo connect to Wi-Fi or the cloud?
Yes, usually through an external module, often an ESP32 acting as the network side, or through a gateway. STM32WB adds BLE and STM32WL adds LoRa on the same chip. If connectivity is the main question, an ESP32 demo is often the more direct first step.
Does an STM32 prototype need a custom PCB?
Not for a first demonstration. A Nucleo or Discovery board plus representative sensors and drivers is usually enough to prove the behavior. A custom PCB matters later for size, cost, power, and manufacturing.
Which development board should we start with?
An official Nucleo or Discovery board from the family that matches the demo, for example STM32G4 for motor control or STM32L4 for battery-powered sensing. They include a debugger and are easy to buy again.
What should I bring to an STM32 consultation?
The behavior the device must show, the sensors and actuators involved, any timing, accuracy, or power targets, the hardware you already have, and the decision the demo needs to support.
Discuss your STM32 demo for free
Tell us the behavior the device must show, the sensors or actuators involved, and the numbers it has to hit. Consultation is non-binding.
Share your idea →