Most ESP32 vs STM32 comparisons are written for weekend projects, where the cheapest board with Wi-Fi wins. A commercial connected product is judged on different things: whether the part will still be in production in 2035, whether the radio can be certified without a full test campaign, whether a control loop keeps its timing while the Wi-Fi stack is busy, and what the device really draws asleep and on waking.
This guide compares the two on those terms, using datasheet figures rather than forum benchmarks, and ends with a decision table by product type and a note on when a Nordic or Raspberry Pi part beats both.
ESP32 vs STM32: The Families Worth Considering in 2026
Neither name refers to one chip. Espressif sells a family of wireless SoCs built around its radio; ST sells dozens of microcontroller series, only a few with a radio.
| Part | Core and clock | Radio | Typical role |
|---|---|---|---|
| ESP32 (classic) | 2 × Xtensa LX6, 240 MHz | Wi-Fi 4, Bluetooth 4.2 Classic and LE | Existing designs; the only member with Bluetooth Classic |
| ESP32-S3 | 2 × Xtensa LX7, 240 MHz, SIMD | Wi-Fi 4, Bluetooth 5 LE | Displays, audio, light ML |
| ESP32-C3 | RISC-V, 160 MHz | Wi-Fi 4, Bluetooth 5 LE | Low-cost Wi-Fi nodes and co-processors |
| ESP32-C6 | RISC-V, 160 MHz, plus low-power core | Wi-Fi 6 (2.4 GHz), Bluetooth 5 LE, 802.15.4 | Matter over Wi-Fi or Thread |
| ESP32-C5 | RISC-V, 240 MHz | Dual-band Wi-Fi 6, Bluetooth 5 LE, 802.15.4 | Products needing 5 GHz Wi-Fi |
| ESP32-H2 | RISC-V, 96 MHz | Bluetooth 5 LE, 802.15.4 | Thread and Zigbee end devices |
| ESP32-P4 | 2 × RISC-V, 400 MHz | None | Camera, display and video |
| STM32G0 / G4 | Cortex-M0+ 64 MHz / Cortex-M4 170 MHz | None | Low-cost control / motor control and digital power |
| STM32L4 / U5 | Cortex-M4 80 MHz / Cortex-M33 160 MHz | None | Battery-powered and secure low-power hosts |
| STM32H5 / H7 | Cortex-M33 250 MHz / Cortex-M7 up to 600 MHz | None | Secure gateways / high-performance control |
| STM32WB / WBA | Cortex-M4 + M0+ / Cortex-M33 100 MHz | Bluetooth LE, 802.15.4 | BLE, Thread and Matter devices |
| STM32WL | Cortex-M4 (plus M0+ on WL5) | Sub-GHz, including LoRa | LoRaWAN and private sub-GHz links |
| STM32N6 | Cortex-M55 800 MHz plus 600 GOPS NPU | None | Vision and audio inference |
Every ESP32 except the P4 has a radio, while only a few STM32 series do. ST’s range also runs from a 64 MHz Cortex-M0+ to an 800 MHz Cortex-M55 with a neural accelerator, far more ground than the whole ESP32 line.
Integrated Wi-Fi vs an External Radio Module
The ESP32’s real product is its Wi-Fi. A module such as the ESP32-C6-WROOM-1 puts the SoC, flash, crystal, RF matching and antenna under one shield, and Espressif publishes its approvals: FCC and IC in September 2023, CE in October 2023, then Japan’s TELEC and Korea’s KC in early 2024. For a mains-powered Wi-Fi product that is very hard to beat on bill of materials, board area and certification effort.
No STM32 microcontroller integrates Wi-Fi. An STM32 product that needs it carries a second module with its own firmware, host interface and update path, a cost worth paying only when the STM32 earns its place for another reason: control timing, low power, analogue performance, security certification or longevity. For Bluetooth LE and Thread the gap closes: ST’s STM32WB5MMG module lists CE, FCC, IC, KC, SRRC and Japanese approvals, and the newer STM32WBA5MMG lists CE, FCC, ISED and MIC, with more planned.
Modular approval covers the radio. The finished product still needs unintentional-emissions testing (FCC Part 15 Subpart B in the US), and the approval only holds if you follow the module’s rules on antenna, ground clearance and keep-out areas. Swapping the antenna or burying the module mid-board is how teams end up paying for intentional-radiator testing anyway, which is why these calls belong in IoT hardware design.
Many commercial products use both: an STM32 for the time-critical work and an ESP32-C3 or C6 purely as a Wi-Fi co-processor. That means two firmware images, an inter-chip protocol and a recovery plan for a hung co-processor, all of which need designing up front as part of embedded firmware development.
Real-Time Behaviour and Performance Compared
On benchmarks the ESP32 looks strong. Espressif’s datasheets list 1,329.92 CoreMark for the dual-core ESP32-S3 at 240 MHz and 496.66 for the ESP32-C6; ST lists 655 for the STM32U5A and 1,023 for the STM32H5. What those numbers hide is where code executes from and what else shares the core.
ESP32 parts run code from external flash through a cache. By default ESP-IDF disables that cache during flash writes, and while it is off, interrupt handlers not registered as IRAM-safe do not run; one that touches flash-resident code in that window crashes the chip. A log write or OTA download can therefore stretch interrupt latency in ways a bench test never shows. The Wi-Fi and Bluetooth stacks also run high-priority tasks: on the dual-core ESP32 and S3 you can pin control work to the other core, but on the C3 and C6 the stack shares the only high-performance CPU.
An STM32 executes from internal flash through ST’s ART accelerator, on most series has no radio stack competing for the core, and services interrupts through the Cortex-M NVIC with short, predictable latency. For motor control, power conversion or any deadline measured in microseconds, that determinism is worth more than CoreMark.
ESP32 vs STM32 Power Consumption: Datasheet Sleep Figures
Sleep current is where the families diverge most, and where headline figures mislead most. These are typical values from current datasheets.
| Part | Mode | Typical current | What is kept |
|---|---|---|---|
| ESP32 (classic) | Deep-sleep, RTC timer and memory | 10 µA | RTC memory |
| ESP32 (classic) | Hibernation, RTC timer only | 5 µA | Timer only |
| ESP32-C3 | Deep-sleep | 5 µA | RTC memory |
| ESP32-S3, C6, H2 | Deep-sleep | 7 µA | RTC or low-power memory |
| STM32U5A | Stop 3, 40 KB SRAM retained | 2 µA | Retained SRAM and registers |
| STM32U5A | Standby with RTC | 480 nA | Backup domain |
| STM32U5A | Shutdown | 150 nA | Wake-up pins only |
The bigger difference is what waking means. ESP32 deep sleep powers down the CPU and main memory, so every wake is effectively a reboot through the bootloader. An STM32 in a Stop mode keeps RAM and registers and carries on where it stopped. A sensor that wakes every few seconds pays the ESP32’s boot cost every time, which is partly why the C6 has a separate low-power core.
Active current finishes the picture. The ESP32-C6 datasheet gives a 354 mA peak transmitting 802.11b at 21 dBm, which no coin cell can supply, so Wi-Fi products are mains-powered or rechargeable whatever the sleep figure says. And small sleep differences add up: an extra 5 µA over three years is about 131 mAh, more than half a CR2032’s nominal capacity. Turning figures like these into a budget is covered in power management in IoT devices.
ESP32 vs STM32 Security, Toolchains and Longevity
- ESP32 series: secure boot and flash encryption across the range, with keys in eFuse. The classic ESP32 supports RSA secure boot only; the C6, H2 and P4 add ECDSA secure boot and a trusted execution environment. The ESP32-C6 reached PSA Certified Level 2 in February 2025, and the H2 holds Level 1.
- STM32 series: Arm TrustZone on the Cortex-M33 parts, TF-M support and a hardware unique key. The STM32U5 and STM32WBA5 families hold PSA Certified Level 3 and SESIP Level 3, and the STM32H573 targets the same level.
Level 3 matters because its evaluation includes physical attacks such as fault injection, a known weak point for older ESP32 parts. Espressif has published advisories since 2019 showing that voltage and electromagnetic glitching can bypass secure boot or expose flash-encryption keys on affected parts, and has added hardware glitch countermeasures to newer series; check its current advisory for the exact part and silicon revision. If an attacker with your device on a bench is in your threat model, that is a selection criterion. Certificates and identity, the other half of the problem, are covered in IoT device security. In the EU, Cyber Resilience Act vulnerability reporting has applied since 11 September 2026, so a signed, recoverable path for OTA updates matters as much as the boot chain.
ESP-IDF is Espressif’s FreeRTOS-based framework, and each release is supported for 30 months. ST’s equivalent is STM32Cube: CubeMX for pin, clock and peripheral configuration, HAL and LL drivers, middleware packs and STM32CubeIDE. Both families are supported upstream in Zephyr, the most practical way to keep application code portable between them, though ESP-IDF gets new radio features first. The trade-offs are covered in why Zephyr is gaining momentum in IoT.
Espressif publishes a commitment per chip from a fixed start date: at least 15 years for the classic ESP32 (to 2031) and at least 12 for newer parts, taking the S3 and C3 to 2033, the C6 and H2 to 2035, and the P4, C5 and C61 to 2037. ST lists STM32 part numbers in its longevity programme with a 10-year commitment renewed annually, so check the exact part number. For a product launching in 2027 with a ten-year field life, the classic ESP32’s 2031 date already falls inside the window.
ESP32 or STM32: A Decision Table by Product Type
| Product | Usual choice | Why | Watch for |
|---|---|---|---|
| Mains-powered Wi-Fi device | ESP32-C6 module, or C5 for 5 GHz | Wi-Fi, BLE and Thread in one certified module | Interrupt latency during flash writes if it also does control |
| Coin-cell sensor (BLE or Thread) | STM32WBA, or a Nordic nRF54L | Sub-microamp standby, fast wake, no Wi-Fi peaks | ESP32-H2 works for Thread, but every deep-sleep wake is a reboot |
| Motor control or digital power | STM32G4 | High-resolution timer, CORDIC and FMAC, ST motor-control SDK | Add an ESP32-C3 for Wi-Fi rather than running the loop on it |
| Battery LTE-M tracker | STM32U5 or L4 host plus LTE-M module, or a Nordic nRF91 | No ESP32 has cellular; host sleep current counts once the modem sleeps | Modem and GNSS energy dominate; budget them first |
| Camera or edge AI device | STM32N6 for NPU inference; ESP32-P4 for video; ESP32-S3 for small models | 600 GOPS NPU, or H.264 and MIPI-CSI, or SIMD on a budget | The P4 needs a C6 or C5 alongside for wireless |
On motor control, the STM32G4’s high-resolution timer (HRTIM) resolves 184 ps. The ESP32, S3, C6 and H2 do have an MCPWM peripheral, adequate for simple drives, but field-oriented control on a commercial product is better served by ST’s accelerators and tooling. On edge AI, memory decides more than TOPS, as the peak activation memory problem in TinyML on microcontrollers shows.
Nordic’s nRF52 and nRF54L series are the usual choice for coin-cell Bluetooth LE; the nRF54L15 pairs a 128 MHz Cortex-M33 with 1.5 MB of non-volatile memory, and Nordic’s SDK is built on Zephyr. Its nRF91 series combines an LTE-M and NB-IoT modem with an application core. Raspberry Pi’s RP2350 (dual Cortex-M33 or RISC-V cores at 150 MHz, 520 KB SRAM, TrustZone, signed boot) has no radio, but its programmable I/O suits wired controllers, and it is committed to production until at least January 2045.
Frequently Asked Questions
Conclusion
The ESP32 vs STM32 choice is rarely about speed. It turns on whether the product’s hardest requirement is low-cost Wi-Fi, or timing, sleep current, security evidence and a long production life. Where the answer is both, two chips with a clean interface usually beat one chip doing everything badly, and each vendor’s longevity date should be checked before the schematic is frozen.
We write production firmware for ESP32 and STM32 products; see our firmware development services.
