Quick Answer
Choose ESP32 when Wi-Fi and/or Bluetooth need to be built into the chip itself. Choose STM32 when the product needs deterministic real-time control, a wide choice of peripherals, or a family of parts spanning multiple price and performance tiers. Choose RP2040 when unit cost is the dominant constraint or the Programmable I/O (PIO) blocks fit an unusual timing or protocol requirement. Many production designs use two of the three together — an STM32 or RP2040 for control paired with an ESP32 module for connectivity — rather than asking one chip to do everything. The rest of this article walks through why, one factor at a time.
ESP32 vs STM32 vs RP2040 at a Glance
| Factor | ESP32 | STM32 | RP2040 |
|---|---|---|---|
| Core | Dual-core Xtensa (LX6/LX7 depending on variant) | Cortex-M0/M0+/M3/M4/M7 (family-dependent) | Dual-core Cortex-M0+ |
| Typical clock speed | Up to ~240MHz | From under 100MHz up to ~480MHz depending on family | 133MHz |
| Onboard wireless | Wi-Fi + Bluetooth/BLE built in | None — external module required | None — external module required |
| Real-time determinism | Moderate; networking stack adds jitter | Strong — built for control loops | Strong for PIO-driven I/O; simple general CPU |
| On-chip SRAM | 520KB (ESP32), 512KB (ESP32-S3) | A few KB to over 1MB depending on family | 264KB (flash is external) |
| Unit cost at volume | Moderate; bundles radio and antenna matching | Wide range across the family | Low; well under $1 per chip |
| Low-power sleep | Deep sleep around 10µA; Wi-Fi transmit bursts draw a few hundred mA | Best of the three; ultra-low-power L/U families reach sub-µA standby | Dormant mode available, but sleep current is far higher than STM32L or ESP32 deep sleep |
| Main toolchains | ESP-IDF, Arduino core for ESP32 | STM32CubeMX + CubeIDE, HAL/LL libraries | Pico C/C++ SDK, MicroPython, Arduino-Pico |
| Best known for | Built-in wireless connectivity | Deterministic control, broad peripheral set | Low cost, flexible I/O via PIO |
Processing Capability
ESP32 runs a dual-core Xtensa processor (LX6 on the original ESP32, LX7 on the S3 variant) clocked up to around 240MHz, with enough headroom to run networking and application logic side by side. STM32 spans a huge range — from Cortex-M0/M0+ parts suited to simple control tasks, through mainstream Cortex-M4 parts with a floating-point unit, up to Cortex-M7 parts running near 480MHz for heavier computation — so "STM32" alone doesn't say much about available processing headroom without naming a specific family. RP2040 is comparatively modest on paper (dual Cortex-M0+ at 133MHz, no FPU), but its two Programmable I/O (PIO) blocks — eight state machines in total — can offload cycle-accurate protocol handling from the main cores entirely, which changes what "processing capability" actually means for I/O-heavy designs.
Wireless Connectivity
ESP32 is the only one of the three with wireless built into the chip — a mature Wi-Fi and Bluetooth/BLE stack that makes it the fastest path to a connected product. STM32 and RP2040 have no onboard radio, so any wireless requirement means adding an external module (commonly BLE, Wi-Fi, LoRa or cellular) and designing the RF layout and antenna matching around it yourself.
Power Consumption
For battery-powered products, STM32's dedicated ultra-low-power families lead on deep-sleep current, often reaching microamp-level sleep draw. RP2040's power draw is modest and predictable, since there's no radio or heavy peripheral set drawing current in the background. ESP32's deep-sleep current is competitive, but its active draw during Wi-Fi transmission is significantly higher than either — so the real power budget for an ESP32-based product depends heavily on how often and how long the radio transmits, not just its sleep current.
Development Ecosystem
ESP32 development happens mainly through Espressif's ESP-IDF (the full-featured native framework) or the Arduino core for ESP32, both actively maintained with a large community and extensive example code. STM32 uses ST's HAL/LL libraries and STM32CubeMX for peripheral configuration, alongside CubeIDE or a toolchain of your choice; the ecosystem is mature and well documented but has a steeper initial learning curve than Arduino-style development. RP2040 is supported by the official Raspberry Pi Pico SDK (C/C++) and by MicroPython/CircuitPython for faster prototyping, with a community that's grown quickly given how recently the chip launched.
Real-Time Requirements
STM32 is purpose-built for deterministic control: predictable interrupt latency, hardware timers, and peripheral sets aimed at motor control, power conversion and similar closed-loop work. RP2040's main cores aren't particularly fast, but its PIO blocks execute custom I/O protocols with cycle-accurate timing independent of what the CPU is doing elsewhere — a different class of real-time problem, closer to bit-banging a protocol precisely than running a fast control loop. ESP32's real-time behaviour is the weakest of the three for hard real-time work, since its Wi-Fi/Bluetooth stack runs on the same cores and introduces timing variability that a pure control application usually can't tolerate.
Cost and Availability
RP2040 was explicitly designed to hit an aggressive unit price at volume, and Raspberry Pi's supply chain has generally kept it well stocked. ESP32 modules cost more per unit but bundle the radio, antenna matching, and — for certified modules — regulatory approval, which is real engineering cost you'd otherwise carry yourself. STM32 spans an enormous range of price points across dozens of part numbers in the same family, useful for scaling one firmware base across product tiers — but availability varies by specific part, so it's worth checking current lead times and second-source options for the exact variant you're specifying, not just the family name.
Security Considerations
All three have some form of hardware security support, but the depth differs. STM32 — particularly its higher-end and dedicated secure families — tends to offer the most complete secure-boot and cryptographic-acceleration options, aimed at products that need formal security certification. ESP32-S3 and later ESP32 variants include secure boot and flash encryption suitable for protecting firmware IP and preventing unauthorised flashing, which matters for any connected product exposed to the internet. RP2040 has comparatively limited built-in security hardware; its RP2350 successor added more, so if secure boot or cryptographic acceleration is a hard requirement, it's worth confirming the exact silicon revision rather than assuming based on the chip family name alone.
Suitable Applications
- ESP32: connected consumer devices, smart-home products, IoT sensors reporting over Wi-Fi/BLE, and anything where a phone app pairs directly with the device.
- STM32: motor control, power electronics, industrial automation, safety-relevant or certification-heavy products, and multi-tier product families sharing one firmware base.
- RP2040: cost-sensitive electronics, custom protocol or timing-critical I/O handled via PIO, and designs that pair it with a separate connectivity module.
RP2040 vs ESP32-S3
This is the head-to-head we're asked about most, because both chips are inexpensive, dual-core and well supported by Arduino and MicroPython. The deciding question is wireless. The ESP32-S3 has 2.4GHz Wi-Fi and Bluetooth LE 5 on-chip, two Xtensa LX7 cores at up to 240MHz, 512KB of SRAM, native USB and vector instructions that speed up small on-device ML models. The RP2040 has no radio, two Cortex-M0+ cores at 133MHz and 264KB of SRAM, but its PIO blocks drive custom interfaces — addressable LEDs, extra UARTs, parallel displays — with exact timing, at well under $1 per chip.
Pick the ESP32-S3 when the product must join Wi-Fi, pair with a phone over BLE, or run a small ML model at the edge. Pick the RP2040 when the product is wired or uses a separate radio, unit cost dominates, or you need precisely timed custom I/O. If the RP2040 fits but you need more headroom or secure boot, its successor the RP2350 (Cortex-M33 at 150MHz, 520KB SRAM, Arm TrustZone) is the natural step up.
STM32 vs RP2040
Neither has built-in wireless, so this comparison comes down to control, peripherals and cost. STM32 wins on breadth: hardware floating point on Cortex-M4/M7 parts, advanced motor-control timers, CAN/FDCAN, better analog front-ends, true ultra-low-power modes, and parts ranging from small 20-pin packages to 480MHz Cortex-M7 devices. RP2040 wins on price and simplicity: one part number, a generous 264KB of SRAM, a drag-and-drop USB bootloader and PIO for unusual interfaces — but no FPU, no CAN, no on-chip flash and a basic 12-bit ADC with four external channels.
Pick STM32 for motor control, power conversion, CAN-bus and industrial products, battery devices that sleep most of the time, or a product family that needs several price tiers. Pick RP2040 for cost-sensitive wired devices, USB peripherals and designs where PIO replaces an extra interface chip. Switching platforms after the firmware is written is expensive, so if you're torn, our embedded firmware development team can prototype the critical path on both before you commit.
Decision Checklist
- Does the product need built-in Wi-Fi or Bluetooth? If yes, ESP32 is the default unless a strong reason points elsewhere.
- Does the product need deterministic, low-jitter control loops? STM32 is usually the better fit.
- Is unit cost the dominant constraint at volume? RP2040 (or a specific low-cost STM32 part) is worth costing out.
- Does the project need an unusual, cycle-accurate I/O protocol? RP2040's PIO is worth a serious look.
- Does the product need certified security (secure boot, crypto acceleration) for compliance? Check STM32's secure families or ESP32-S3 and later, against your specific certification target.
- Would a two-chip architecture — control plus a connectivity module — reduce risk more than one chip trying to do everything?
- Have you checked current stock and lead time for the specific part number, not just the chip family?
Which One Should You Choose?
Choose ESP32 when the core requirement is wireless connectivity. Choose STM32 for deterministic real-time control, a rich peripheral set, or a product family spanning multiple price points. Choose RP2040 when unit cost is the dominant constraint and I/O needs benefit from PIO's flexibility. Many real products combine two of these — an STM32 or RP2040 for control paired with an ESP32 module for connectivity — which is often more robust than asking one chip to do everything.
How PAK-EL LAB Can Help
PAK-EL LAB designs embedded hardware and firmware across all three of these platforms, and helps clients make this exact decision early — before schematic capture locks in a direction that's expensive to change later. Whether your project needs ESP32-based IoT connectivity, an STM32 real-time control core, an RP2040 for a cost-sensitive design, or a multi-chip architecture that combines their strengths, our team can scope the right microcontroller strategy for your product and carry it through PCB design, firmware, and manufacturing.
Related service: Embedded Firmware Development
Frequently Asked Questions
Can I add Wi-Fi to an STM32 or RP2040 design?
Yes, by adding an external Wi-Fi or BLE module and designing the RF layout around it. This is common in STM32 and RP2040 designs that need connectivity, though it adds board space, cost and RF design work that ESP32 avoids by having the radio built in.
Is RP2040 powerful enough for a commercial product?
Yes, for many products, particularly ones limited by unit cost or built around PIO-driven I/O. It is not the right choice for compute-heavy applications or hard real-time control loops, where STM32 is usually the better fit.
Which of the three is easiest to get started with?
ESP32 with the Arduino framework and RP2040 with MicroPython both have a lower initial learning curve than STM32's HAL/CubeMX workflow, though STM32's ecosystem is arguably the most mature for production firmware once you are past initial setup.
Can a single product use more than one of these microcontrollers?
Yes, and it is a common architecture: an STM32 or RP2040 handling real-time control paired with an ESP32 module providing Wi-Fi/Bluetooth connectivity, communicating over UART or SPI between the two.
Does PAK-EL LAB develop firmware for all three platforms?
Yes. We design hardware and firmware for ESP32, STM32 and RP2040-based products, and can help decide between them as part of scoping a new project.