HK LIANYIXIN INDUSTRIAL CO., LIMITED  |  aero@uavchip.com  |  +86 157-0660-6161
← Back to Blog
MCU Design

STM32 vs ESP32 for Drone Flight Controllers: Which MCU Should You Choose?

March 2025  ·  9 min read  ·  UAVCHIP Engineering Team

STM32 microcontroller PCB for drone flight controller
Choosing the wrong MCU for your drone flight controller can mean missed attitude loops, jitter in servo outputs, and crashes. This guide breaks down STM32 vs ESP32 so you can make an informed decision.

The two most-discussed microcontrollers in the UAV hobbyist and professional community are the STM32 series from STMicroelectronics and the ESP32 from Espressif. Both are powerful, affordable, and well-supported — but they are designed with very different priorities in mind.

Architecture Overview

STM32: Purpose-Built for Real-Time Control

STM32 MCUs are based on the ARM Cortex-M core (M0, M3, M4, M7, M33 depending on series). The STM32F4 series (e.g. STM32F405RGT6) runs at 168 MHz with a hardware FPU (Floating-Point Unit), making it ideal for PID control loops that run at 1–8 kHz. The STM32F7 steps up to 216 MHz, while the STM32H7 reaches 480 MHz with dual-core support.

Key peripherals for flight control include: up to 17 timers (PWM generation, input capture for SBUS/PPM), multiple SPI/I2C/UART buses, DMA controllers, and hardware CRC. The HAL and LL libraries are mature, and open-source flight stacks like Betaflight, ArduPilot, and PX4 all run natively on STM32.

ESP32: Wi-Fi + Bluetooth First, Real-Time Second

The ESP32 is a dual-core Xtensa LX6 (or RISC-V in ESP32-C3/C6/H2 variants) running at 240 MHz. It has built-in Wi-Fi 802.11b/g/n and Bluetooth 4.2/5.0 — making it a natural choice for IoT, home automation, and wireless sensor nodes.

While ESP32 has timers and PWM capability, the FreeRTOS-based architecture and Wi-Fi interrupt load introduce latency jitter that is problematic for precise flight control loops. There is no hardware FPU on the original ESP32 (the ESP32-S3 does include one), and peripheral count is lower than comparable STM32 devices.

Performance Comparison Table

FeatureSTM32F405RGT6ESP32-D0WDQ6
CPU CoreARM Cortex-M4Xtensa LX6 (dual)
Max Clock168 MHz240 MHz
FPUYes (hardware)No (software emulation)
Flash1 MBNone (external required)
SRAM192 KB520 KB
Timers17 (advanced + basic)4 (hardware) + LED PWM
SPI/I2C/UART3/3/64/2/3
Wi-Fi / BTNoYes (both)
Real-time OS supportFreeRTOS, ChibiOS, ZephyrFreeRTOS (ESP-IDF)
Betaflight/PX4 support✅ Full support❌ Not supported

Real-Time Performance: Why It Matters for Drones

A flight controller must execute its attitude estimation and PID control loop at a consistent interval — typically 1 kHz for brushless motor control, or up to 8 kHz for racing drones running Betaflight. Any jitter in loop timing results in oscillations, reduced PID performance, or propwash.

The STM32 achieves this with deterministic interrupt handling, dedicated DMA for IMU data transfers, and no competing high-speed peripherals like Wi-Fi. The ESP32's Wi-Fi stack runs at high priority and regularly preempts user tasks, introducing unpredictable delays of 1–10 ms — unacceptable for any flight critical loop.

When Should You Use ESP32 in a Drone?

ESP32 is not a bad chip — it's just a bad flight controller chip. It excels in the following drone-adjacent roles:

For any of these applications, ESP32 is an excellent choice because its connectivity strengths are an asset rather than a liability.

Which STM32 Variant Is Right for Your Drone?

Within the STM32 family, different variants suit different build types:

Community and Toolchain Support

Both platforms have excellent open-source ecosystems. STM32CubeIDE, STM32CubeMX, and PlatformIO all support STM32. The ESP-IDF and Arduino framework support ESP32. However, for flight control specifically, STM32 dominates: Betaflight, Cleanflight, iNav, PX4, and ArduPilot all either require STM32 or primarily target it.

If your project involves a custom flight controller PCB, you will find far more reference designs, schematics, and community Q&A for STM32-based boards.

Cost Comparison

At UAVCHIP, both chips are stocked in volume. The STM32F405RGT6 runs approximately $4–8 USD in small quantities, while the ESP32-D0WDQ6 is $3–5 USD. For production volumes of 1000+, both are under $3 USD. The cost difference is not a deciding factor — performance and ecosystem fit should drive the decision.

Conclusion: Use STM32 for Flight Control

If you are building a flight controller — whether it's an FPV racing quad, an autonomous agricultural sprayer, or a fixed-wing mapping drone — STM32 is the correct choice. The hardware FPU, deterministic interrupt latency, rich timer peripherals, and full support in all major open-source flight stacks make it the clear winner for this application domain.

Reserve ESP32 for companion boards, wireless bridges, and payload controllers where its connectivity shines. Used in the right role, both chips are excellent. Used in the wrong role, both will let you down.

Need STM32 or ESP32 for Your UAV Project?

UAVCHIP stocks genuine STM32F4, F7, H7 series chips with full traceability. Submit an RFQ or email our team for pricing and availability.

View STM32F405RGT6 Submit RFQ

Frequently Asked Questions

Can ESP32 run Betaflight?

No. Betaflight requires STM32 hardware, specifically STM32F4 or newer. The ESP32 architecture is not compatible with Betaflight's hardware abstraction layer. There are unofficial ports and minimal forks, but none are production-ready or safe for actual flight.

Is STM32H743 worth it for a standard FPV quad?

Generally no — it's overkill for most FPV applications. The STM32F405 is sufficient for 8 kHz Betaflight loops. The H743 makes more sense for custom autopilots with heavy sensor fusion (lidar, optical flow, dual IMU), complex VTOL mixing, or when you need the additional RAM for feature-rich firmware builds.

What is the difference between STM32F4 and STM32F7?

STM32F7 features a Cortex-M7 core with a 6-stage superscalar pipeline and runs at up to 216 MHz (vs 168 MHz for F4). It also includes an L1 cache, ART accelerator, and more RAM. For flight controllers, the F7 mainly benefits designs needing large logging buffers, complex GPS waypoint missions, or heavy filtering algorithms. For basic racing firmware, F4 is sufficient.

Where can I buy genuine STM32 chips for drone production?

UAVCHIP specializes in genuine STM32 components for UAV manufacturers. We stock the most common flight controller MCUs including STM32F405RGT6, STM32F722RET6, STM32F745VGT6, and STM32H743VIT6. All parts come with full test reports and batch traceability.

Related Articles