STM32 vs ESP32 vs RP2040: 2026 Decision Tree
Three MCU families dominate most projects right now. STM32, ESP32, and Raspberry Pi's RP2040/RP2350. Choose poorly and you waste weeks chasing workarounds.
This decision tree guides every spec conversation I have. It opens with one blunt question.
Start with the default winner
Need wireless? Begin with ESP32. Crave deterministic peripherals plus 480 MHz class compute? STM32 leads. Dirt-cheap dual-core control paired with programmable I/O? RP2040 or RP2350 comes first. That forms the tree. All other details refine it.
The RP2350 shipped in August 2024 with the $5 Pico 2. Raspberry Pi delivered something unusual at that price. It runs dual Cortex-M33 or dual Hazard3 RISC-V cores at 150 MHz, gives you 520 KB on-chip SRAM, and throws in three PIO blocks with twelve state machines. The bare chip runs $0.80 in volume. I don't think most engineers realize how aggressive that pricing is until they try to build a bill of materials with it.
On the Espressif side, the ESP32-S3-DevKitC-1-N8R8 is $15.00 on DigiKey right now. That's 8 MB flash and 8 MB octal PSRAM with Wi-Fi and Bluetooth LE already on the module. You're not buying a radio. You're buying a radio that happens to have an LX7 dual-core CPU bolted to it. Every other approach to adding wireless to a microcontroller project adds cost, adds a PCB antenna you have to tune, and adds firmware you have to write.
The STM32H743ZI on the NUCLEO board runs a Cortex-M7 up to 480 MHz with 2 MB flash and 1 MB SRAM. Six SPI ports. Four I2C buses. Two CAN FD interfaces. USB OTG with both high-speed and full-speed PHYs on die. An ST-LINK debugger is built into the board.
Start with which one of those three paragraphs describes your project. That's your default. Test against it before you get clever.
Match architecture to workload
480 MHz Cortex-M7 cores with double-precision FPU and L1 cache power the STM32H743ZI. ST reports 1027 Dhrystone MIPS and 2.14 DMIPS per MHz. Those specs let you run motor control loops, display framebuffers, and CAN bus stacks together without forcing an RTOS into aggressive slicing.
If I'm being honest, the ESP32-S3 gets overlooked for its compute side because people fixate on the Wi-Fi. The Xtensa LX7 dual-core at 240 MHz isn't just a radio controller. Espressif added 128-bit vector instruction extensions called PIE, specifically for accelerating complex multiplication, addition, and shifting in DSP and AI workloads. Wake-word detection and small image recognition models run on-device without touching a cloud endpoint.
PIO changes everything on the RP2040. Two blocks hold four state machines each. They share 32-instruction program memory per block. Nine instructions total. Yet each machine watches and tweaks up to 30 GPIOs at full system speed. The Raspberry Pi Foundation's own guidance is blunt. If you're thinking about bit-banging a protocol, don't. Write a PIO program instead. This applies to anything that repeatedly reads or writes GPIOs, but especially data transfer protocols.
RP2350 doubled down. Three PIO blocks, twelve state machines, and you still get to pick Cortex-M33 or Hazard3 RISC-V at boot time per the datasheet. The ARCHSEL register in OTP determines which processor connects to each socket when reset releases. That's not a gimmick. That's real architectural flexibility for a chip at this price.
Dave's Take: The PIE vector extensions on the ESP32-S3 are real, but I haven't seen a third-party benchmark that isolates their contribution to actual inference latency. Espressif's own examples are hand-tuned wake-word detectors. Compared to what? A Cortex-M4 with CMSIS-DSP? Show me the numbers.
Price hides the real tradeoff
STM32H750VBT6 costs $9.37 on DigiKey. It delivers a 480 MHz Cortex-M7 with 1 MB SRAM. That sounds expensive next to RP2350 at $0.80. Yet the STM32 buys you 128 KB of flash, dual-bank architecture, and a peripheral set that includes a Chrom-ART graphics accelerator and hardware JPEG codec. Try building an HMI panel with any Raspberry Pi MCU and tell me how that goes.
STM32L476RGT6 lists at $9.10 for a Cortex-M4 at 80 MHz with 1 MB flash and 128 KB SRAM. The NUCLEO-L476RG board sits at $14.85. That part draws 100 microamps per megahertz in run mode with the internal LDO, dropping to 39 microamps per megahertz in SMPS mode. Stop 2 mode gets you down to 1.1 microamps with RTC running. Shutdown hits 30 nanoamps. You're not paying for speed. You're paying for a power-optimized sleep architecture that took ST decades to build into a mature family.
The Raspberry Pi Pico 2 launched at $5. Bare RP2350A chips cost $0.80 in bulk, $1.10 single-unit. That dual-core, dual-architecture design lets you choose between Cortex-M33 and RISC-V on the same silicon. No other MCU in that price range gives you two architectures on one die.
When someone claims the RP2350 wins on cost they speak truth about chip price alone. They often ignore five extra external parts the STM32 already folds in. Development time for those missing peripherals never stays free.
Dave's Take: That STM32H750VBT6 at $9.37 only gives you 128 KB of flash. One hundred twenty-eight kilobytes. On a 480 MHz M7. You're running code from external QSPI or PSRAM, which adds BOM cost, board space, and wait states. The $9.37 number is technically correct but practically misleading for anyone who hasn't read the H750 errata.
Availability and tools decide builds
ESP32-S3-WROOM-1 modules sit on DigiKey shelves right now. N16R8 variant runs $6.76. N8R2 costs $5.49 with 1,733 units in stock. Bare ESP32-S3 in 56-QFN package lists at $1.85. Real inventory beats promised allocations every time.
ESP32-S3-DevKitC-1-N8R8 boards price out at $15.00 on DigiKey. Espressif's documentation describes it as an entry-level dev board with integrated Wi-Fi and Bluetooth LE. A $15 board holding 8 MB flash and 8 MB PSRAM changes what experiments feel safe when wireless sits on the roadmap.
STM32 boards like NUCLEO-H743ZI ship with on-board ST-LINK/V2-1 debuggers. One less tool clutters the bench. ST dropped STM32CubeIDE 2.1.0 on March 26, 2026 with Arm Clang based on Clang 21.1.1 and GCC-14.3.1 as default toolchain. They added native AArch64 macOS support and CMake presets. If you're on an Apple Silicon Mac, you're no longer fighting the toolchain. That matters for team builds where not everyone runs Linux.
Pico SDK 2.2.0 tagged in July 2025 added self-decrypting binary support and Wi-Fi firmware partitioning for the Pico 2 W. ESP-IDF v6.0.1 dropped April 10, 2026 as the current stable release. Those cadences tell you whether the platform is actively maintained or coasting. All three are moving fast right now.
The Detroit News reported in February 2026 that a new memory shortage driven by AI data-center HBM demand is building. When that hits MCU availability again, you want to be building on a platform with deep second-source options. I refuse to get caught short twice.
Benchmarks favor different winners
CoreMark comes closest to fair cross-MCU comparison. Still, higher scores never guarantee a superior chip. They simply signal faster execution on that exact workload.
STM32H743ZI hits 2424 CoreMark and 1027 DMIPS from flash at zero wait states. L1 cache makes those numbers possible. ST's datasheet confirms them. Cortex-M7 at 480 MHz with both caches engaged works wonders until code spills out.
Community ports clock RP2040 at 235.84 CoreMark on a single Cortex-M0+ core running 125 MHz stock. That equals roughly 1.89 CoreMark per MHz. Overclocked samples reach 400 MHz and 798.37 CoreMark yet sit outside spec. No FPU or DSP extensions means integer tests and floating-point tests tell completely different stories.
ESP32 scores 498 single-core at 240 MHz for about 2.08 CoreMark per MHz. Dual-core jumps to 991 CoreMark at the same 240 MHz. Community ports using ESP-IDF, GCC, and -O3 produced those figures. Wider Xtensa LX7 pipeline plus dual FPU registers help even before vector extensions enter play.
ST's NUCLEO-H563ZI with Cortex-M33 at 250 MHz reaches 1023 CoreMark from ITCM with DTCM data at zero wait states. Arm Clang v6.16, -Ofast, and link-time optimization delivered the official EEMBC numbers. CoreMark per MHz lands near 4.09.
Never select solely on CoreMark. Never dismiss it either.
Three traps kill otherwise good designs
I've watched these exact mistakes burn experienced teams. They burned me once too.
ESP32 Wi-Fi current spikes top the list. Datasheet claims 240 mA peak transmit current. Real tests prove worse. First WiFi.scanNetworks() call averages 500 mA for 10 milliseconds and hits four peaks of 700 mA. Later behavior settles at 130 mA average with 600 mA spikes. Size your supply or LDO around datasheet figures and brownouts become certain.
STM32H7 cache coherency with DMA acts sneakier because crashes stay intermittent. ST's application note AN4839 spells it out. DMA completion demands cache invalidation before CPU reads the updated region. Otherwise stale cache data hides fresh SRAM contents. Post-reset requires invalidating each cache before enable or behavior turns unpredictable. External ASICs or FIFOs often force complete D-cache disable on reads. One missing invalidation cost me a full week chasing phantom corruption.
RP2040 floating-point handling stays brutally simple. Both cores are Cortex-M0+ lacking FPU and DSP extensions. Libgcc and libm emulate every float operation. SIO hardware speeds integer divide and modulo alone. FFT or sensor fusion with trig functions burns hundreds of cycles on manual mantissa and exponent math that Cortex-M4 hardware finishes instantly.
Dave's Take: Those ESP32 current measurements from the forum thread are from a specific scan scenario, not steady-state Wi-Fi. Real-world TX at 802.11n MCS7 is closer to 286 mA per Espressif's own module datasheet. The 700 mA peaks are real but you need to specify the test conditions or people will overspec their power supply for the wrong reason.
Choose for the next revision
I frame 2026 choices by looking two board spins ahead. No one thanks you for short-term convenience that blocks future features.
Thread, Zigbee, or Matter in the product roadmap? ESP32-C6 becomes the on-ramp. Espressif calls it their first Wi-Fi 6 SoC. It pairs a RISC-V core at 160 MHz with a low-power RISC-V coprocessor at 20 MHz, running Wi-Fi 6 with OFDMA and downlink MU-MIMO alongside Bluetooth 5 LE and an 802.15.4 radio all sharing one antenna. That's the Thread and Zigbee radio you need for Matter compliance, already integrated. You won't find that combination from STM32 without adding a discrete 802.15.4 transceiver.
RP2350 fixes the security gaps that kept RP2040 out of commercial designs. Signed boot, OTP memory, SHA-256 hardware acceleration, a true random number generator, glitch detectors, and Arm TrustZone now exist. If you walked away from Raspberry Pi for production reasons the RP2350 earns reevaluation.
STM32 stays the safest bet for industrial growth. The family stretches from ultra-low-power L-series to M7 monsters while ST refreshes the toolchain aggressively. CubeIDE 2.1.0 in March 2026 brought Clang 21.1.1 and GCC 14.3.1. That investment signals ST refuses to surrender the embedded space.
RISC-V deserves attention as strategic insurance. Espressif's ESP32-C6 and RP2350's Hazard3 cores ship in volume. The wider RISC-V IP ecosystem expands while NVIDIA has used RISC-V inside GPUs since 2015. Arm boasts 150 billion chips shipped and twenty-five years of MCU tooling advantage yet the open ISA no longer counts as theory.
Build what ships cleanly in 2027. Easy wins today rarely survive that test.

