STM32 vs ESP32: Choosing the Right Microcontroller for Your Design
STM32 vs ESP32 compared on architecture, Wi-Fi, power, peripherals, toolchains, safety, and longevity. Current 2026 specs from vendor datasheets, plus a decision table.
An STM32 development board (left) alongside an ESP32 development board (right)
Key Takeaways
The ESP32 integrates 2.4 GHz Wi-Fi and Bluetooth on the die.[1] ST's wireless MCU portfolio covers Bluetooth LE, 802.15.4, and sub-GHz, but not Wi-Fi on the MCU die[9](Wi‑Fi is available via separate coprocessor modules such as ST’s ST67W611M1).[6] If your product needs Wi-Fi, that single fact usually settles the choice unless you’re willing to add an external Wi‑Fi module.
The STM32 portfolio is far broader: 1,644 STM32 32-bit Arm Cortex part numbers [3] across high-performance, mainstream, ultra-low-power, and wireless lines, against 14 ESP32‑family SoCs.[10] On raw compute, the STM32N6 leads (up to 3,360 CoreMark) [3], while the classic ESP32 delivers on the order of 1,080 CoreMark in dual‑core configurations [1], so processing power is rarely the deciding factor.
For battery products, ST's near-threshold STM32U3 draws 13 µA/MHz running CoreMark at 48 MHz and 1.6 µA in Stop 3 [7], against about 10 µA for ESP32 deep sleep. [1] What decides battery life is energy per duty cycle, since Wi-Fi association dominates and an STM32 needs a radio beside it.
STMicroelectronics commits to 10 years of availability for listed STM32 parts [19], and Espressif commits to 12 to 15 years for ESP SoCs [17]. Both are real commitments, but they are structured differently.
Introduction
Ask an engineering forum whether to use an STM32 or an ESP32, and you will get answers that talk past each other. One camp is building a Wi-Fi sensor and got a working prototype in an afternoon. The other is shipping an industrial controller that has to pass an IEC 61508 assessment and stay orderable for a decade.
Both camps are right, because these are not competing parts so much as competing design philosophies. The ESP32 family from Espressif Systems is a connectivity-first system-on-chip (SoC) [1] built for devices that need to join a Wi-Fi network without a companion radio. The STM32 from STMicroelectronics is a general-purpose 32-bit microcontroller family that scales from tiny entry-level Cortex-M0+ parts up to 800 MHz Cortex-M55 devices with an on-chip neural accelerator. [3]
Whether you search for STM32 vs ESP32 or ESP32 vs STM32, the underlying question is the same one. The honest answer turns on four questions: do you need Wi-Fi, how tight is the power budget, does the product need certification, and how long must it stay in production?
This guide compares them on the criteria that actually decide the choice: architecture and processing power, wireless communication, power consumption, peripherals, development ecosystem, certification and safety, and long-term supply. It closes with a decision framework and a section on where Arduino fits. Both parts appear across IoT projects, consumer electronics, and industrial equipment, so the comparison is genuinely open rather than a formality.
STM32 vs ESP32 at a Glance
Criterion | ESP32 (original series) | STM32 (portfolio) |
CPU core | Xtensa single/dual core 32-bit LX6, up to 240 MHz | Arm Cortex-M0/M0+, M3, M4, M33, M7, M55 depending on series, up to 800 MHz |
Benchmark | 1,079.96 CoreMark (2 cores at 240 MHz) | Up to 3,360 CoreMark (STM32N6) |
Integrated Wi-Fi | Yes, 802.11 b/g/n | No; available via ST67W611M1 Wi-Fi 6 coprocessor module |
Integrated Bluetooth | Yes, Bluetooth v4.2 BR/EDR and Bluetooth LE | Bluetooth LE on STM32WB, STM32WB0, STM32WBA only |
Sub-GHz radio | No | Yes, on STM32WL (LoRaWAN, Sigfox, W-MBUS, Mioty, Wi-SUN) |
On-chip SRAM | 520 KB, plus 16 KB in RTC | Up to 3 MB (STM32U5), up to 1.4 MB (STM32H7) |
Lowest documented standby | 5 µA hibernation, 10 µA deep sleep | 160 nA shutdown, 530 nA standby with RTC (STM32U575) |
Analog | 12-bit SAR ADC up to 18 channels, two 8-bit DACs | 14-bit ADC at 2.5 Msps, 12-bit ADC autonomous in Stop 2, two 12-bit DACs, two op-amps with PGA, two comparators (STM32U575) |
Functional safety package | Not offered by the vendor | X-CUBE-STL, IEC 61508 SIL2/SIL3, TÜV Rheinland certified |
Vendor longevity commitment | 12 to 15 years from launch date; ESP32 until Jan 2031 | Minimum 10 years for listed parts, renewed annually |
Sources: [1], [3], [4], [6], [9], [10], [11], [16], [17], [19]
Recommended Reading:STM32 Microcontroller: Cores, Peripherals & Tools
Two Different Design Philosophies
The ESP32 exists to put a device on a network cheaply. Espressif describes it as a single 2.4 GHz Wi-Fi-and-Bluetooth SoC (System on a Chip) aimed at mobile, wearable electronics, and Internet-of-Things (IoT) applications. [1] The radio is not a peripheral you bolt on; it is the reason the part exists.
The STM32 exists to be the control element in an embedded system, whatever that system is. The portfolio spans 1,644 STM32 32-bit Arm Cortex part numbers, divided into high performance (515 parts), mainstream (553), ultra-low power (480), and wireless (96) lines.[3] Wireless is one branch of the family, not the trunk.
That difference propagates into everything that follows. It explains why an ultra-low-power STM32 reaches a 530 nA standby state [11] while the ESP32 stops at 10 µA in deep sleep [1], and why ST ships a certified functional safety package while Espressif ships a Wi-Fi stack. [16] The STM32 figure is for the MCU alone; a comparable design needs a radio beside it.
Architecture and Processing Power
Core Architecture: Xtensa, Arm Cortex-M, and RISC-V
The original ESP32 uses Xtensa single- or dual-core 32-bit LX6 microprocessor(s) with a seven-stage pipeline to support clock frequencies up to 240 MHz.[1] The cores are accompanied by an ultra-low-power coprocessor that can run while the main cores are powered down. The Tensilica Xtensa architecture is licensed IP rather than an Espressif design, which matters when you look for compiler and debugger support. The ESP32-S3 moves to a dual-core XTensa LX7 MCU, capable of running at 240 MHz. [2]
Espressif has since split its roadmap. The ESP32-C6 pairs a four-stage-pipeline RISC-V core [5] running up to 160 MHz with a two-stage low-power RISC-V core up to 20 MHz that stays awake during deep sleep while the main core is off — the same idea as the original's ULP coprocessor, better executed. If you assume ESP32 means Xtensa, that has not been reliably true for several generations: the C, H, and P series are all RISC-V.
Every STM32 uses an Arm Cortex-M core. Which one depends on the series: the STM32F103C8 that sits under the widely cloned Blue Pill boards is a 72 MHz Cortex-M3 with 64 KB of flash, still an active part rather than a legacy one. The STM32U0 entry-level ultra-low-power series is Cortex-M0+, the STM32L4 is Cortex-M4, the STM32U3, STM32U5 and STM32L5 are Cortex-M33, the STM32H7 is Cortex-M7, and the STM32N6 is Cortex-M55.[3][18] ST has since added the Cortex-M85 with the STM32V8, announced in November 2025 and still ramping through 2026.
The practical consequence of Arm Cortex-M cores is not performance; it is portability. Toolchains, RTOS ports, CMSIS libraries, debuggers, and engineers' existing knowledge move across vendors. Espressif's Xtensa and RISC-V parts are well supported inside ESP-IDF and much less so outside it.
Clock Speeds and Real Benchmarks
Clock speeds mislead here, so compare CoreMark instead. The ESP32 scores 539.98 on one core at 240 MHz and 1079.96 on two. [1] The dual-core figure is exactly twice the single-core figure, so it represents two cores' scores added rather than a measured dual-core workload.
At the top of ST's range, the STM32N6 reaches 3360 CoreMark [3] from a single 800 MHz Cortex-M55 with the Neural-ART accelerator. The STM32H7 is close behind at up to 3347, but that figure sums a Cortex-M7 at 480 MHz and a Cortex-M4 at 240 MHz [4],, so it describes a chip with two very different cores rather than one fast one. In the middle, the near-threshold STM32U3 manages 395.4 CoreMark at 96 MHz, or 4.12 CoreMark per megahertz [7].
So a top-end STM32 is roughly three times an ESP32 on this benchmark. But that comparison sets ST's flagship against Espressif's mainstream part, and most designs on either side are nowhere near compute-bound. Treat processing power as a filter that rules parts out, not as a ranking that picks one.
DSP, FPU, and Real-Time Behavior
If you are doing signal processing, the core matters.
The ESP32's Xtensa LX6 cores already include a floating-point unit and DSP instruction support. [1] The ESP32-S3 adds vector instructions that accelerate neural-network [2] and signal-processing workloads, which makes it genuinely competitive for on-device audio and small neural networks against mid-range STM32 parts. Espressif's ESP-DSP and ESP-NN libraries are written for Xtensa and RISC-V, and stay inside ESP-IDF.
On the STM32 side, Arm's Cortex-M4, Cortex-M7 and Cortex-M33 carry DSP extensions to the Thumb instruction set with an optional floating-point unit, while the Cortex-M3 in older parts like the F103 has neither and still handles modest signal processing perfectly well. ST's vector answer sits at the top of its range rather than the middle, in the Arm Cortex-M55-based STM32N6 with its Neural-ART accelerator.[3] Arm's CMSIS-DSP runs on any Cortex-M part, so the same code moves between STM32, NXP, and Nordic.
The real-time performance argument for STM32 is less about instructions and more about interference. On an ESP32, the Wi-Fi and Bluetooth stacks share the CPU with your application, and radio activity has timing consequences you do not fully control. On an STM32 driving a motor, nothing is competing for your interrupt latency. If you need tight, provable control loop timing, that isolation is the argument.
Verdict: STM32 for raw headroom and portable Arm tooling; ESP32 when 240 MHz dual-core is plenty and you want the radio in the same package.
Wireless Connectivity: The Decisive Difference
What the ESP32 Integrates
The ESP32 provides 802.11b/g/n Wi-Fi with 802.11n (2.4 GHz), up to 150 Mbps, and is compliant with Bluetooth v4.2 BR/EDR and Bluetooth LE specifications.[1] The ESP32-S3 pairs 2.4 GHz, 802.11 b/g/n Wi-Fi and Bluetooth 5 (LE).[2] The ESP32-C6 goes further with a 2.4 GHz Wi-Fi 6 (802.11ax) radio, Bluetooth 5 (LE), and IEEE 802.15.4 radio that brings Thread and Zigbee into reach.[5]
That last combination matters for smart home devices. Espressif positions the C6 as the part that lets customers build both Matter-compliant Wi-Fi endpoints and Thread endpoints from one design.[5]
Recommended Reading: The Evolution of Wi-Fi networks: from IEEE 802.11 to Wi-Fi 6E
What STM32 Offers
The common claim that STM32 has no wireless is wrong. ST's STM32 wireless MCUs cover the sub-GHz band and the 2.4 GHz range, combining a radio transceiver and an MCU in one part.[9]
The STM32WBA series supports Bluetooth LE and IEEE 802.15.4, including Zigbee, Thread, Matter and Aliro. The STM32WB supports Bluetooth LE and 802.15.4 with Zigbee and Thread, running individually or concurrently. The STM32WB0 is Bluetooth LE only. For long range, the STM32WL integrates an energy-efficient sub-GHz radio on the same die, supporting LoRaWAN, Sigfox, W-MBUS, Mioty and Wi-SUN.[9]
The Asymmetry That Decides Projects
Across every STM32 wireless series ST lists, Wi-Fi does not appear.[9] ST sells it separately instead, as the ST67W series, which it describes as its first Wi-Fi coprocessor line: Wi-Fi 6 and Bluetooth LE 5.4, developed with Qualcomm around the QCC743, and covered by ST's 10-year longevity programme. ST also ships X-CUBE-MATTER for Matter over Wi-Fi with the module, so the path exists and is supported. But it is a second part, a second interface, and more board area.[6]
The gap runs the other way too. No Espressif SoC in the current line-up carries a sub-GHz radio. The newer ESP32-C5 adds 5 GHz Wi-Fi and the E22 reaches Wi-Fi 6E[10], but nothing in the family addresses the sub-GHz bands where metering and long-range telemetry live. For that work the STM32WL has no Espressif counterpart at all.
So the rule of thumb is narrower than "ESP32 for wireless":
Need Wi-Fi? ESP32, unless you are already committed to STM32 for other reasons, in which case the ST67W is a working path at the cost of a second part.
Need only Bluetooth LE, Zigbee, Thread, or Matter? Both are credible. Choose on power, peripherals, and safety needs.
Need long-range sub-GHz, LoRaWAN, or metering? STM32WL. Espressif has no answer.
Verdict: ESP32 for Wi-Fi, STM32WL for sub-GHz, either for Bluetooth LE, Thread or Matter.
Power Consumption and Power Management
Sleep Currents Are Not Comparable by Name
Sleep mode names differ between vendors, so match the states by what stays powered, not by the label.
The ESP32 draws 10 µA in deep sleep with the RTC timer running, and 5 µA in hibernation [1] with the RTC timer only. In deep sleep the CPUs, most of the RAM, and all digital peripherals clocked from APB_CLK are powered off, leaving the RTC controller, RTC peripherals and RTC memories alive. [20]
The ultra-low-power STM32 parts operate a step below. The STM32U575 lists 160 nA in Shutdown with 24 wake-up pins, 210 nA in Standby with 24 wake-up pins, and 530 nA in Standby with the RTC running.[11] Comparing the two RTC-running states, 530 nA against 10 µA, the STM32 draws roughly a twentieth of the current on paper.
Two things to hold onto before that ratio decides anything. These are typical datasheet values at stated conditions, and boards behave worse than dies: regulators, USB-UART bridges and indicator LEDs on a development board can swamp both figures. And the comparison is not like-for-like, because the STM32U575 has no radio. An STM32 doing the ESP32's job needs one beside it, with its own sleep current. For a fairer single-chip number, ST's own STM32WL5x reaches 1.07 µA in Stop mode with the RTC running and full retention, radio included.[21] Still well under the ESP32, and harder to argue with.
State | ESP32 | STM32U575 |
Deepest state, no RTC | 5 µA (hibernation, RTC timer only) | 160 nA (shutdown) |
Deep state with RTC running | 10 µA (deep sleep) | 530 nA (standby with RTC) |
Retention state with SRAM | 0.8 mA (light sleep, RAM and CPU state preserved) | 1.9 µA (Stop 3, 16 KB SRAM), 4.3 µA (Stop 3, full SRAM) |
Active | Radio activity dominates | 19.5 µA/MHz Run mode at 3.3 V |
Source: ESP32 [1] , STM32 [11]
Duty Cycle Usually Matters More Than Sleep Current
For a Wi-Fi node, sleep current is often not the dominant term anyway. Associating with an access point and transmitting costs orders of magnitude more than either chip's sleep state, so the design question becomes how rarely you can afford to wake up.
The rough crossover is worth knowing. If your device wakes and transmits over Wi-Fi more than a few times an hour, the radio dominates the budget, and the MCU's sleep floor barely registers, so choose on other criteria. If it wakes once an hour or less, sleep current becomes most of the budget, and the gap between 530 nA and 10 µA decides how long the battery lasts.
Both vendors give you tools to stay asleep longer. On the ESP32, the ULP coprocessor runs while the chip sleeps, polling sensors, monitoring ADC or GPIO states, and waking the main cores when something happens.[1] Wake-up sources include a timer, touchpad, external pins, and the ULP, with GPIO and UART added in light sleep.
The STM32U5 does the equivalent through autonomous peripherals. Many peripherals stay functional and autonomous down to Stop mode with direct memory access, through ST's low-power background autonomous mode, and the DMA controllers keep running in Stop mode.[11] The newer STM32U3 attacks the other half of the budget: it is the first STM32 built on near-threshold technology [7], which cuts dynamic consumption rather than leakage, and matters precisely when your device is awake more than it sleeps.
For a coin-cell sensor measured in years, this gap is the whole design. For a mains-powered smart plug, it is irrelevant, and your attention belongs elsewhere.
Verdict: STM32 by roughly twenty times in standby, but only if your device sleeps most of the time; otherwise the radio decides.
Peripherals, I/O, and Interfaces
GPIOs, ADCs, and DACs
The ESP32 offers 34 programmable GPIOs, of which five are strapping pins and six are input-only.[1] That input-only subset catches people out, because it means those pins cannot drive anything. A further six are consumed by in-package flash on the ESP32-U4WDH and in-package PSRAM on the D0WDRH2-V3, so on those parts the usable count drops again. The ESP32-S3 improves matters with 45 programmable GPIOs.[2]
The contrast on a comparable STM32 is stark. The STM32U575 offers up to 136 fast I/Os with interrupt capability, most of them 5 V-tolerant, and up to 14 with an independent supply down to 1.08 V. [11] Pin count is rarely the reason to pick a part, but it is often the reason a design outgrows one.
On analog, the ESP32 has a 12-bit SAR ADC with up to 18 channels and two 8-bit DACs. Eight bits gives you 256 output levels, which is coarse for anything beyond a crude reference voltage. This is one of the clearest places where the ESP32 is outclassed. If you need clean analog output, check the DAC resolution of the specific STM32 part you are considering, since not every STM32 carries one.
Communication Interfaces
The ESP32 provides four SPI interfaces, two I2C interfaces, three UART interfaces, two I2S interfaces, an Ethernet MAC interface, an SD/eMMC/SDIO host, and LED PWM up to 16 channels.[1] It also has TWAI, compatible with ISO 11898-1 (CAN Specification 2.0), so a CAN bus is available despite the unfamiliar name.[1]
A mid-range STM32 outclasses this on breadth rather than raw count. The STM32U575 carries four I2Cs, three SPIs, three USARTs, two UARTs, one low-power UART, two SAIs, a digital camera interface, two SDMMCs, one FDCAN, one USB OTG full-speed, a USB Type-C and USB Power Delivery controller, and a parallel PSSI interface.[11] On the interfaces both parts share, the counts are close: the ESP32 actually has more SPIs. The gap is in kinds, not quantity.
Three entries have no ESP32 equivalent. FDCAN is CAN with flexible data rate, which matters in automotive electronics and industrial control. USB Power Delivery is increasingly a product requirement rather than a nice extra. And the low-power UART keeps working in Stop mode, which is what lets a battery design receive a command without waking the core.
Recommended Reading: Understanding CAN Bus: A Comprehensive Guide
Timers and Motor Control
Motor control still favors the STM32, but not for the reason usually given. The STM32U575 has up to 17 timers and 2 watchdogs, among them 2 16-bit advanced motor-control, 4 32-bit, 5 16-bit, 4 low-power 16-bit (available in Stop mode) and 2 SysTick timers.[11]
The ESP32 is not empty-handed here, contrary to a common assumption. Espressif documents an MCPWM peripheral with dead-time insertion, fault detection, and a brake function, so complementary outputs and hardware fault shutdown are available. Complementary outputs, hardware dead-time, and hardware fault shutdown are all present.
The real differences are elsewhere. Channel count: two MCPWM units against the U575's two dedicated advanced-control timers plus fifteen others, which decides how many axes or phases one chip can drive. Determinism: the radio stacks share the CPU on an ESP32, and a control loop that must not jitter is competing with them. And tooling: ST's motor-control software ecosystem is more developed than Espressif's, which often decides a project schedule rather than a datasheet line.
Even the long-serving STM32F103C8 is described by ST as a part with motor control, USB, and CAN.[18] That is a 72 MHz Cortex-M3 from a mainstream line, and it still targets a job the ESP32 is not built for.
Verdict: STM32 for analog fidelity, motor control, and interface breadth; ESP32 is sufficient for sensor and network work.
Recommended Reading: Motor Speed Control: Methods Across Motor Types
Development Ecosystems
ESP-IDF and the Arduino Path
ESP-IDF is Espressif's native framework, and its support policy is explicit: each ESP-IDF major and minor release is supported for 30 months after the initial stable release date, split into a 12-month service period and an 18-month maintenance period during which only bug fixes for high-severity issues or security issues will be applied.[12]
Knowing that number is more useful than it looks. It tells you how often a long-lived product will be forced through a framework migration, and 30 months is a shorter horizon than the hardware longevity commitment discussed below.
For the Arduino IDE route, Espressif maintains the core itself and documents it on its own site, covering ESP32, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-H2, ESP32-P4, ESP32-S2, and ESP32-S3.[8] The ESP32-C2 and ESP32-C61 are also supported, but only by using Arduino as an ESP-IDF component or rebuilding the static libraries, which is not a beginner's path. This vendor-maintained Arduino path is a genuine advantage for rapid prototyping and for teaching.
STM32CubeIDE, STM32CubeMX, and STM32duino
On the ST side, STM32CubeIDE is a multi-OS C/C++ integrated development environment for STM32 code development, with support for GCC and Clang toolchains and for ST-LINK and SEGGER J-Link debug probes.[13] It is normally used alongside the STM32CubeMX graphical configuration tool, which generates initialization code from a pinout and clock-tree configuration.[13]
Two changes here matter in 2026, and both are recent enough to invalidate an older evaluation.
First, the IDE has split in two. STM32CubeIDE now ships in two variants: the Eclipse-based one launched in 2019 and a VS Code-based one launched in 2025, and ST states it is currently focusing resources on the VS Code-based IDE variant to make it the primary IDE platform.[13] The VS Code variant is still maturing, though. Its March 2026 release was the first major enhancement since launch, and project conversion still does not handle multi-context projects such as dual-core or TrustZone designs.
Second, and easier to miss, STM32CubeMX is no longer bundled with the IDE. ST now distributes it as a standalone tool, so CubeIDE and CubeMX are separate installs.[13] If you last set up an STM32 toolchain a few years ago, expect a different sequence
Arduino support for STM32 comes through the STM32duino community project, which covers a long list of families from STM32C0 through STM32WL and STM32MP1, and since core release 2.8.0, it supports only Arduino IDE 2.[14] Note the difference in provenance: Espressif documents its Arduino core on its own documentation site, while the STM32 core lives in a separate community organization. That is not a quality judgement, but it does decide who fixes a bug and how soon a new part gets support: Espressif's core is a vendor deliverable; STM32duino is not.
RTOS, Languages, and Third-Party Toolchains
Both platforms are commonly used with an RTOS. Espressif documents ESP-IDF's FreeRTOS implementation as supporting dual-core symmetric multiprocessing, which lets tasks run across both cores without you writing the scheduling yourself. FreeRTOS is equally available on STM32 through STM32CubeMX's middleware options.[13] STM32CubeIDE includes RTOS debug among its debug features.[13]
Beyond the vendor IDEs, STM32 embedded development is widely done in third-party toolchains such as IAR Embedded Workbench and Keil MDK, which matter mostly because certification bodies often expect a qualified compiler. On the ESP32 side, PlatformIO is a popular alternative build environment, and MicroPython gives you a scripting route that suits quick IoT projects and classroom work better than C does.
The Learning Curve Is Real
For a first project, the ESP32 wins on time-to-blink. Install a board package, pick a development board, and you have Wi-Fi in a few lines.
STM32CubeMX shortens the STM32 ramp considerably, but you still meet clock trees, alternate function mapping, and DMA configuration earlier. That upfront cost buys you transferable skills: an engineer who knows STM32Cube can move to almost any Arm Cortex-M vendor.
Verdict: ESP32 for a faster start, STM32 for skills and toolchains that transfer.
Certification, Safety, and Production Readiness
Radio Certification
This is the ESP32's strongest production argument, and it is frequently underrated. Espressif sells pre-built modules with an integrated antenna, and the ESP32-WROOM-32 datasheet lists an on-board PCB antenna, 4 MB SPI flash, and a footprint of 18 x 25.5 x 3.1 mm.[15]
Using a module means the RF layout, the crystal, the matching network, and the antenna are somebody else's solved problem. Designing an STM32 board with a separate Wi-Fi module gets you to a similar place, but designing a discrete radio does not.
There is a cost to the integrated flash worth knowing at schematic stage: it occupies GPIO6 through GPIO11, and those six pins cannot be used as regular GPIOs. [15]
One current caveat that overview articles rarely carry: every page of the ESP32-WROOM-32 datasheet is stamped Not Recommended For New Designs, still true of the current version 3.7.[15] And it is not just that module. The ESP32-WROVER and the ESP32-WROOM-32D and 32U datasheets carry the same stamp. The classic module line as a whole is on its way out, even though it still dominates tutorials and marketplace listings. Check the module status in Espressif's product selector before you commit a footprint.
Functional Safety
If your product needs a safety argument, the STM32 has one and the ESP32 does not. ST publishes X-CUBE-STL, a functional safety package for STM32 microcontrollers in systems implementing safety functions up to IEC 61508 safety integrity level SIL2/SIL3.[16]
The structural detail matters for architecture decisions: SIL2 safety functions can be implemented with a single STM32 MCU; SIL3 safety functions implementation requires two STM32 MCUs in an 1oo2 scheme.[16] If you are targeting SIL3, budget for two microcontrollers from the start.
The package also helps target ISO 13849, IEC 62061, and IEC 61800, includes an MCU FMEA giving a detailed list of MCU failure modes and related mitigation measures adopted, and ships a diagnostic library designed to detect random hardware failures in STM32 application-independent core components (CPU + SRAM + flash memory) that is certified by TÜV Rheinland to IEC 61508:2010 SC3.[16]
Note: Coverage is not portfolio-wide. X-CUBE-STL is available for the STM32F0, F1, F3, F4, F7, G0, G4, H7, L0, L4, L4+, L5 and WL series, plus the STM32MP1.[16] The ultra-low-power U5 and U3, the STM32H5, the wireless WBA, and the new N6 are not on that list. If safety certification is a requirement, it narrows your part choice before any other criterion does.
For medical devices, industrial automation, and machinery, this evidence package is not a bonus feature. It is the difference between a viable certification path and a rewrite.
Security
Both platforms offer hardware security, so this is rarely a differentiator on its own. The ESP32 has secure boot, flash encryption, and cryptographic hardware acceleration: AES, Hash (SHA-2), RSA.[1] The ESP32-S3 adds AES-XTS-based flash encryption, RSA-based secure boot, digital signature and HMAC plus a World Controller peripheral providing two fully-isolated execution environments.[2]
Recent STM32 series match this from the Arm side, with the STM32U5 and STM32L5 built on Cortex-M33, which brings TrustZone.[3]
Longevity and Supply
Both vendors publish commitments, and the shapes differ.
Espressif's longevity page lists ESP32 at 15 Years with an end date of Jan 1, 2031, and ESP32-S3 at 12 Years ending Jan 1, 2033.[17] These are fixed end dates per SoC family, so the remaining window shrinks as the calendar advances.
ST runs a tiered program with 7, 10, 15 and 20-year commitments depending on the product family. STM32 microcontrollers sit in the 10-year tier, and ST states the commitment is renewed annually. For each part number in the program, ST warrants a specific date until which the part remains orderable, shown in an "available until" column and repeated as an icon on the part's own product page. ST's own worked example makes the mechanism plain: STM32N6 parts warranted to January 2035 in 2025 roll to January 2036 in 2026 if they stay in the program, and freeze at the old date if they drop out. [19]
A concrete example shows how this plays out. The STM32F103C8, a part that has been in production for well over a decade, is listed as Active and available until January 2036.[18] For a product with a long service life, a per-part guarantee that rolls forward is a different risk profile from a fixed family end date.
Verdict: ESP32 for pre-certified radio modules, STM32 for functional safety evidence and rolling per-part longevity.
STM32 vs ESP32 vs Arduino
This comparison confuses people because Arduino is not the same kind of thing. STM32 and ESP32 are silicon. Arduino is a development board family and, more importantly here, a programming API and toolchain.
You can program both an STM32 and an ESP32 through the Arduino IDE. Espressif maintains its own Arduino core covering the ESP32, C3, C5, C6, H2, P4, S2, and S3, with the C2 and C61 supported only through the ESP-IDF component route.[8] STM32duino provides Arduino support across most STM32 families, though since core release 2.8.0 it requires Arduino IDE 2.[14]
So the practical question is rarely STM32 or ESP32 or Arduino. It is:
Which silicon fits the product requirements, using the criteria above?
Which API do you want to develop against that silicon: Arduino for speed and simplicity, or the vendor framework (ESP-IDF or STM32Cube) for full hardware access?
The boards themselves make the point. The Arduino UNO R4 WiFi pairs a Renesas RA4M1 microcontroller with an ESP32-S3-MINI-1 module for connectivity. Arduino is the layer above the silicon, not a competitor to it.
The 8-bit Arduino boards are a separate matter, and the line has moved: the UNO R3 is an ATmega328P, but the UNO R4 is already a 32-bit Arm Cortex-M4 at 48 MHz.
Both an STM32 and an ESP32 are 32-bit microcontrollers with far more memory, more peripherals, and much higher clock speeds. If you are moving up from an Uno R3, either is a large step forward.
For a broader look at how these platform choices compare, see Wevolver's guides to Arduino vs Raspberry Pi and microcontroller vs microprocessor.
Which Should You Choose?
Your situation | Choose | Why |
Wi-Fi-connected product, cost-sensitive | ESP32 | Radio on the die and pre-certified modules; no second part, no second certification |
Battery product running for years on a coin cell | STM32 ultra-low power | 530 nA standby with RTC versus 10 µA deep sleep, though the STM32 figure is MCU-only |
Motor control, power conversion, robotics | STM32 | Two dedicated advanced-control timers among seventeen, plus a more developed motor-control software ecosystem |
Safety-related industrial or medical device | STM32 | X-CUBE-STL provides the IEC 61508 SIL2/SIL3 evidence package on supported series |
LoRaWAN or metering over long range | STM32WL | Integrated sub-GHz radio; no Espressif SoC has one |
Smart home endpoint using Matter or Thread | Either | ESP32-C6 and STM32WBA both cover 802.15.4, Thread, and Matter |
Rapid prototyping, hobby, or teaching | ESP32 | Fastest path to a connected prototype, vendor-maintained Arduino core |
Learning transferable embedded skills | STM32 | Arm Cortex-M knowledge transfers across the whole MCU industry |
Product needing high analog fidelity | STM32 | ESP32 DACs are only 8-bit, check the specific STM32 part has a DAC |
Product with a 10 year plus service life | STM32 | Per-part-number longevity that rolls forward, not a fixed family end date |
Sources: [1], [3], [6], [9], [10], [11], [16], [19]
There is also a legitimate "both" answer. A common industrial architecture puts an STM32 on the deterministic control loop and an ESP32 alongside it as a network coprocessor, with SPI or UART between them. You pay for two parts and gain clean separation between real-time control and connectivity.
Recommended Reading: STM32 Selection Guide: Choosing the Right Part for Your Design
Common Mistakes to Avoid
Assuming ESP32 means Xtensa. The ESP32-C6 and its siblings are RISC-V.[5] Verify the core before you assume library or toolchain compatibility.
Designing in the classic WROOM-32. It is marked NRND, and so are the WROVER and the WROOM-32D and 32U.[15] Tutorials have not caught up with the datasheet.
Treating ESP32 GPIO count as usable pin count. Six of the 34 are input-only and five are strapping pins.[1] On a module, another six go to the SPI flash. Read the pin restrictions before you route.
Expecting an 8-bit DAC to do analog output. If audio quality or precise analog control matters, check this parameter early.[1]
Comparing sleep modes by name. Match states by what remains powered, then compare currents.
Assuming STM32 cannot do wireless. It does Bluetooth LE, Zigbee, Thread, Matter, and sub-GHz.[9] Wi-Fi is the gap, and ST fills that with a separate coprocessor rather than an integrated radio.[6]
Assuming any STM32 can be certified. X-CUBE-STL covers the F0, F1, F3, F4, F7, G0, G4, H7, L0, L4, L4+, L5 and WL series plus the STM32MP1. The U5, U3, H5, WBA and N6 are not on that list. [16]
Planning a 10 year product on a 30-month framework. ESP-IDF releases are supported for 30 months.[12] Plan the migrations.
Conclusion
The STM32 vs ESP32 question has a reliable shortcut: if your product needs Wi-Fi, start with the ESP32 and justify moving away. If it does not, start with the STM32 and justify moving to the ESP32.
That works because the ESP32's decisive advantage is an integrated Wi-Fi radio in a pre-certified module at low cost, and the STM32's decisive advantages are breadth, deterministic real-time control, analog and timer quality, ultra-low-power standby, functional safety evidence, and per-part longevity.
Everything else on the spec sheet is secondary. Processing power rarely decides it; both platforms have capable security, and both have credible Arduino paths for getting started. Pick on connectivity, power budget, certification path, and service life, and the rest follows.
Frequently Asked Questions
Is STM32 more powerful than ESP32?
Yes, at the top of the range. The STM32N6 reaches 3,360 CoreMark from a single 800 MHz Arm Cortex-M55 core [3], against 1,079.96 CoreMark for a dual-core ESP32 at 240 MHz. [1] But the STM32 portfolio also includes parts far slower than any ESP32, so "STM32" is not a single performance level. Compare the specific part numbers you are considering.
What is the main difference between STM32 and ESP32?
The main difference between STM32 and ESP32 is integrated Wi-Fi. The ESP32 has an on-die 2.4 GHz Wi-Fi and Bluetooth radio[1]; no STM32 has Wi-Fi on the die. ST covers other protocols instead: STM32WB, STM32WB0 and STM32WBA carry Bluetooth LE and 802.15.4, and STM32WL carries a sub-GHz radio for LoRaWAN. [9]
Should I learn STM32 or ESP32 first?
Learn the ESP32 first if you want a connected project working quickly, since Wi-Fi needs only a few lines of code. Learn the STM32 first if you want transferable skills, because Arm Cortex-M knowledge, CMSIS and standard debug tooling apply across most MCU vendors. Many engineers learn both, and either can be started through the Arduino IDE.
Can I use the Arduino IDE with STM32?
Yes. The STM32duino core brings Arduino support to STM32, covering families from STM32C0 through STM32WL and the STM32MP1. Since core release 2.8.0, only Arduino IDE 2 is supported. Unlike Espressif's Arduino core, STM32duino is maintained by a community project rather than by ST. [14]
Which uses less power, STM32 or ESP32?
An ultra-low-power STM32 uses far less power in standby. The STM32U575 draws 530 nA[11] in standby with the RTC running, against 10 µA for ESP32 deep sleep[1], roughly a twentieth. That STM32 figure covers the MCU alone, though, and a Wi-Fi design needs a radio beside it. In active operation, Wi-Fi transmission dominates the budget.
Does the ESP32 support CAN bus?
Yes. The ESP32's TWAI controller is compatible with ISO 11898-1 classical frames, though it needs an external transceiver.[1] It does not support CAN FD; for that you need an STM32 with FDCAN or a newer Espressif part such as the ESP32-C5.
What are the disadvantages of the ESP32?
Eight-bit DACs, only 34 GPIOs[1] with six input-only and five strapping, and no sub-GHz radio in the family[10]. Espressif offers no functional safety package, the radio stacks share the CPU, and the classic WROOM-32 module line is marked NRND.[15]
What are the disadvantages of the STM32?
No integrated Wi-Fi anywhere in the wireless portfolio, a steeper initial learning curve, and a connected design that needs a second part for Wi-Fi.[9][6] The 1,644-part portfolio is also genuinely hard to navigate for a newcomer.[3]
Is the ESP32 suitable for industrial use?
Often, yes, and Espressif targets industrial automation. The limits are functional safety, where ST has a TÜV-certified package and Espressif has none, and hard real-time determinism, since the radio stacks share the CPU. [16]
References
[1] Espressif Systems, "ESP32 Series Datasheet," v5.3, Jul. 2026. [Online]. Available: https://documentation.espressif.com/esp32_datasheet_en.html [Accessed: Sep. 10, 2026]
[2] Espressif Systems, "ESP32-S3 Wi-Fi and BLE 5 SoC." [Online]. Available: https://www.espressif.com/en/products/socs/esp32-s3 [Accessed: Sep. 10, 2026]
[3] STMicroelectronics, "STM32 32-bit Arm Cortex MCUs." [Online]. Available: https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html [Accessed: Sep. 10, 2026]
[4] STMicroelectronics, "STM32H7 Series: Arm Cortex-M7 and Cortex-M4 MCUs." [Online]. Available: https://www.st.com/en/microcontrollers-microprocessors/stm32h7-series.html [Accessed: Sep. 10, 2026]
[5] Espressif Systems, "ESP32-C6 Wi-Fi 6, Bluetooth LE 5 and Thread/Zigbee SoC." [Online]. Available: https://www.espressif.com/en/products/socs/esp32-c6 [Accessed: Sep. 10, 2026]
[6] STMicroelectronics, "Faster IoT Innovation with ST67W, the First Wi-Fi Coprocessor Series." [Online]. Available: https://www.st.com/content/st_com/en/campaigns/st67w-wifi6-bluetooth-thread-module-z13.html [Accessed: Sep. 10, 2026]
[7] STMicroelectronics, "STM32U375xx Datasheet," DS14861 Rev. 4, Sep. 2026. [Online]. Available: https://www.st.com/resource/en/datasheet/stm32u375ce.pdf [Accessed: Sep. 10, 2026]
[8] Espressif Systems, "Getting Started with Arduino ESP32." [Online]. Available: https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html [Accessed: Sep. 10, 2026]
[9] STMicroelectronics, "STM32 Wireless MCUs." [Online]. Available: https://www.st.com/en/microcontrollers-microprocessors/stm32-wireless-mcus.html [Accessed: Sep. 10, 2026]
[10] Espressif Systems, "SoCs." [Online]. Available: https://www.espressif.com/en/products/socs [Accessed: Sep. 10, 2026]
[11] STMicroelectronics, "STM32U575ZI Product Page." [Online]. Available: https://www.st.com/en/microcontrollers-microprocessors/stm32u575zi.html [Accessed: Sep. 10, 2026]
[12] Espressif Systems, "ESP-IDF Support Policy," GitHub repository. [Online]. Available: https://github.com/espressif/esp-idf/blob/master/SUPPORT_POLICY.md [Accessed: Sep. 10, 2026]
[13] STMicroelectronics, "STM32CubeIDE." [Online]. Available: https://www.st.com/en/development-tools/stm32cubeide.html [Accessed: Sep. 10, 2026]
[14] STM32duino, "Arduino_Core_STM32: STM32 Core Support for Arduino," GitHub repository. [Online]. Available: https://github.com/stm32duino/Arduino_Core_STM32 [Accessed: Sep. 10, 2026]
[15] Espressif Systems, "ESP32-WROOM-32 Datasheet," v3.7, Aug. 2026. [Online]. Available: https://documentation.espressif.com/esp32-wroom-32_datasheet_en.pdf [Accessed: Sep. 10, 2026]
[16] STMicroelectronics, "X-CUBE-STL: STM32 Functional Safety Package." [Online]. Available: https://www.st.com/en/embedded-software/x-cube-stl.html [Accessed: Sep. 10, 2026]
[17] Espressif Systems, "Longevity Commitment." [Online]. Available: https://www.espressif.com/en/products/longevity-commitment [Accessed: Sep. 10, 2026]
[18] STMicroelectronics, "STM32F103C8 Product Page." [Online]. Available: https://www.st.com/en/microcontrollers-microprocessors/stm32f103c8.html [Accessed: Sep. 10, 2026]
[19] STMicroelectronics, "Product Longevity." [Online]. Available: https://www.st.com/content/st_com/en/about/quality-and-reliability/product-longevity.html [Accessed: Sep. 10, 2026]
[20] Espressif Systems, "Sleep Modes," ESP-IDF Programming Guide. [Online]. Available: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/sleep_modes.html [Accessed: Sep. 10, 2026]
[21] STMicroelectronics, "Long-Range Wireless STM32WL Microcontrollers." [Online]. Available: https://www.st.com/en/microcontrollers-microprocessors/stm32wl-series.html [Accessed: Sep. 10, 2026]
in this article
1. Key Takeaways2. Introduction3. STM32 vs ESP32 at a Glance4. Two Different Design Philosophies5. Architecture and Processing Power6. Wireless Connectivity: The Decisive Difference7. Power Consumption and Power Management8. Peripherals, I/O, and Interfaces9. Development Ecosystems10. Certification, Safety, and Production Readiness11. Longevity and Supply12. STM32 vs ESP32 vs Arduino13. Which Should You Choose?14. Common Mistakes to Avoid15. Conclusion16. Frequently Asked Questions17. References