Hello! Welcome to Embedic!
This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Embedded Events > ESP32 vs STM32, Which is Better and How to Choose 2023

ESP32 vs STM32, Which is Better and How to Choose 2023

Date: 16-11-2022 ClickCount: 28693

For microcontroller practitioners, STM32 should be a series of microcontrollers that are more familiar, while ESP32 is relatively unfamiliar. But from the name, both should be 32-bit microcontrollers. So what is the relationship between the two, or which one has better performance and which one has worse performance? Today, as a microcontroller enthusiast, let me briefly analyze the topic ESP32 vs STM32.

 

 

1. Introduction of STM32

 

The STM32 series is designed for ARM Cortex®-M0, M0+, M3, M4 and M7 cores designed for embedded applications requiring high performance, low cost, and low power consumption. Divided into different products according to the core architecture:

 

Mainstream products (STM32F0, STM32F1, STM32F3), ultra-low power products (STM32L0, STM32L1, STM32L4, STM32L4+), high-performance products (STM32F2, STM32F4, STM32F7, STM32H7)

 

Feauters of STM32

 

1. STM32 is a version of the arm core, which is much more advanced than the traditional 51 microcontroller. There are many resources that 51 does not have, such as the usb controller. Moreover, the machine cycle has been abolished, and the speed is not comparable to 51.

 

2. STM32 MCU programs are modular, and the interface is relatively simple, because it has many functions and works fast. However, 51 has few functions of its own, requires many peripheral components, and requires familiarity with electronics.

 

3. Before the STM32F105 and STM32F107 interconnected series microcontrollers, STMicroelectronics has launched the STM32 basic series, enhanced series, USB basic series, and complementary series; the new series of products follow the 72MHz processing frequency of the enhanced series. Memory includes 64KB to 256KB flash memory and 20KB to 64KB embedded SRAM. The new series comes in three packages: LQFP64, LQFP100 and LFBGA100.

 

2. Introduction of ESP32

 

ESP32 is a series of low-cost, low-power microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series adopts Tensilica Xtensa LX6 microprocessor, including dual-core and single-core versions, built-in antenna switch, RF radio frequency module, power amplifier, low noise receiving amplifier, filter and power management module.

 

The Advantages of ESP32

 

#1. Cheap

For many IoT systems, a significant portion of the bill of materials (BOM) cost is for connectivity and microcontrollers. ESP32 modules are very inexpensive compared to many other connectivity solutions on the market today.

 

#2. It's a Bluetooth/Wi-Fi combo module

When it comes to IoT, there is definitely a need to be able to support multiple connectivity solutions. In some cases, Bluetooth may be better suited for local connectivity needs, while Wi-Fi connectivity is necessary for cloud and remote interaction with devices. When a single module can provide both solutions, it is definitely a win-win, not only for the developer but also for the end user. If the product only requires Wi-Fi connectivity, the Bluetooth stack can be disabled, or Bluetooth can be left as a feature added later. Some customers opted for the ESP32's Wi-Fi capabilities and later enabled Bluetooth to expand the feature set for their products.

 

#3. It Has Broad Ecosystem Support

The ESP32 has a surprisingly wide ecosystem. While one may initially find many open source/hobbyist toolchains and libraries, such as those provided through the Arduino IDE, more professional environments are also available. For example, the development tools and software frameworks provided by Espressif seem robust enough to meet the needs of most embedded developers, and there is even support for ESP32 in the Amazon FreeRTOS ecosystem.

 

#4. Options Available for Additional Flash and pSRAM

The ability to scale the solution with the amount of external flash memory included in the ESP32 module helps determine the data storage size for the application. There are even some modules, like the ESP32-WROVER, that can expand RAM via pSRAM connected to the internal microcontroller's SPI bus. The pSRAM can expand the RAM by up to 4MB, giving the module enough memory for almost any application.

 

#5. You can install and run MicroPython

ESP32 can install MicroPython on the module and develop applications with Python. This isn't necessarily the preferred solution for production systems, but it does open up the ability to rapidly prototype a system and prove that it works.

 

In short: The potential to use these modules to reduce costs by integrating multiple connectivity solutions in a single module is high, the ability to expand the memory of the module even offers the potential that all the intelligence can also be contained within the ESP32 module itself, careful software partitioning can Allows embedded developers to address connectivity and real-time software constraints on a single low-cost module.

 

Further Reading: ESP32 based hiking camera

 

Discussion: ESP32 VS STM32, Which is better? [HOT!]

 

First of all, let's talk about STM32, which everyone should be familiar with. STMicroelectronics released the world's first STM32 product, the F1 series, on June 11, 2007, based on the ARM-CORTEX core. In the following years, a variety of products with different positioning and directions were successively released. There are L series for low power consumption, high-performance F2 and F4 series, low-cost F0 series, high-speed F7 series and so on.

 

stm32

Therefore, you will find that STM32 is not a specific microcontroller model, but a collective name for one or more series of microcontroller families based on the ARM core.

 

So, what is ESP32?

 

It is a chip with a dual-core system composed of two Harvard-structured Xtensa LX6 CPUs launched by Espressif. All on-chip memory, off-chip memory, and peripherals are distributed over the data and/or instruction buses of the two CPUs.

 

Compared with a large family of STM32, although ESP32 also represents a series, but at present, the members of this series are still relatively small, let's take a look:

 

First look at the hardware of ESP32, I will directly put the configuration in the official data sheet:

 

  • CPU: Xtensa dual-core (or single-core) 32-bit LX6 microprocessor, operating at 160/240 MHz and performing at up to 600 DMIPS
  • Ultra-low-power (ULP) co-processor
  • Memory: 320 KiB RAM, 448 KiB ROM
  • Wireless connectivity:
  • Wi-Fi: 802.11 b/g/n
  • Bluetooth: v4.2 BR/EDR and BLE (share with Wi-Fi)
  • Peripheral interfaces:
  • 34 × programmable GPIOs
  • 12-bit SAR ADC up to 18 channels
  • 2 × 8-bit DACs
  • 10 × touch sensors (capacitive sensing GPIOs)
  • 4 × SPI
  • 2 × I²S interfaces
  • 2 × I²C interfaces
  • 3 x UARTs
  • SD/SDIO/CE-ATA/MMC/eMMC host controller
  • SDIO/SPI slave controller
  • Ethernet MAC interface with dedicated DMA and planned IEEE 1588 Precision Time Protocol support
  • CAN bus 2.0
  • Infrared remote controller (TX/RX, up to 8 channels)
  • Motor PWM
  • LED PWM (up to 16 channels)
  • Hall effect sensor
  • Ultra-low-power analog pre-amplifier

 

The functional block diagram is as follows:

 functional block diagram of esp32

 

The pin distribution of the module (non-chip) is as follows:

 

 esp32 pinout

 

You will find that the ESP32 module does not have many IOs, and it is estimated that there are only about 30 (the chip has 34, but the external FLASH in the module uses up some). But you will find that it has several characteristics:

 

1. It integrates a lot of peripheral interfaces, such as SPI, IIC, IIS, AD, DA, PWM, IR, UART, CAN, etc. There is a limited number of IOs, so basically each IO has multiple functions.

 

2. The on-chip flash and ram are very large, the flash is 448KB, and the ram is 520KB. And a 4MB flash is directly hung on the module. It's too big!

 

3. Fast! Although the frequency of the external crystal is only 40MHZ, it can support 80MHZ, 160MHZ, 240MHZ through the internal main frequency, and the computing power is as high as 600MIPS.

 

4. There are wifi and bluetooth! Currently both cannot be used at the same time.

 

So, how does it compare with STM32? In other words, which one of STM32 do we use to compare with ESP32?

 

Here, I chose STM32F407VET6,

 

Comparing the two, you will find that STM32F407 has the following characteristics:

 

1. There are a lot of GPIOs, 82, and there are many functions such as UART, IIC, SPI, PWM, AD, DA, etc., but there will be no shortage of GPIOs like ESP32.

 

2. The main frequency is 168MHZ, which is lower than the 240HMZ of ESP32. The computing power is 210DMIPS, which is also lower.

 

3. The flash and ram are relatively small.

 

4. The wired network port cannot access the Internet wirelessly.

 

After comparison of ESP32 VS STM32, you will find that the two basically have different positions. ESP32 tends to be small in size, super fast, and powerful. It is connected to the network through wifi, and it is specially born for the Internet of Things; while STM32 tends to have rich pins and comprehensive functions. Although it does not have wifi and Bluetooth, and the speed is not as fast as ESP32, it can pass The network port is connected to the network and can control more peripherals, which is born for consumer electronics and industrial control.

 

Therefore, the positioning of the two is not the same. As an engineer, you must select the chip according to your own project needs.

 

Further Reading:

ESP32 vs ESP8266, Which is Better and How to Choose?

RP2040 vs ESP32: Which Microcontroller is Best for Your Project 2023?

ESP32 vs Arduino: What are Differences and How to Choose

 

 

  • What is Automotive MCU and How to Choose 2022
  • ESP32 vs ESP8266, Which is Better and How to Choose?

Author

Kristina Moyes is an experienced writer who has been working in the electronics industry for the past five years. With a deep passion for electronics and the industry as a whole, she has written numerous articles on a wide range of topics related to electronic products and their development. Kristina's knowledge and expertise in the field have earned her a reputation as a trusted and reliable source of information for readers interested in the latest advancements in electronics.

Hot Products

  • ADSP-BF504BCPZ-3F

    Manufacturer: Analog Devices

    IC CCD SIGNAL PROCESSOR 88LFCSP

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • AVCE6467TZUTL1

    Manufacturer: Texas Instruments

    IC DGTL MEDIA SOC 529BGA

    Product Categories: SOC

    Lifecycle:

    RoHS:

  • TMS320DM8168ACYG2

    Manufacturer: Texas Instruments

    IC DGTL MEDIA PROCESSR 1031FCBGA

    Product Categories: DSP

    Lifecycle:

    RoHS:

  • TMS320C6455DZTZA

    Manufacturer: Texas Instruments

    IC DSP FIXED-POINT 697FCBGA

    Product Categories: DSP

    Lifecycle:

    RoHS:

Customer Comments

  • Looking forward to your comment

  • Comment

    Verification Code * 

Compare products

Compare Empty