Differences Between STM32, GD32, and ESP32

01

Introduction

STM32: Released by STMicroelectronics on June 11, 2007, this is a 32-bit microcontroller.

GD32: Released by GigaDevice in 2013, this product closely mimics STM32 in chip development, configuration, and naming; even the GPIO is pin-to-pin compatible, allowing for direct replacement without modification. Sometimes, STM32 source code can be recompiled and flashed onto GD32 without changes. However, there are many differences, such as serial drivers, USB, library files, etc.

ESP32: Developed by Espressif in 2017, unlike STM32 and GD32, ESP32 primarily targets the Internet of Things (IoT) field, supporting many functions but having fewer GPIO pins, with most pins having multiple functions. It comes with integrated Bluetooth and WiFi, essential for IoT, and is compact in size, making it suitable for IoT applications.

01

Differences Between GD32 and STM32

GD32 is a domestic microcontroller, reportedly developed by engineers from ST. GD32 is based on STM32 as a template, so there are many similarities. However, GD32 is a different product, and not everything can be carried over from STM32; there are some distinct features developed independently. The differences are as follows:

1. Core

GD32 uses the second-generation M3 core, while STM32 primarily uses the first-generation M3 core. The following is ARM’s errata for the M3 core, with GD32’s core having only one bug, 752419.

Differences Between STM32, GD32, and ESP32

2. Clock Frequency

Using HSE (High-Speed External Clock): GD32’s maximum clock frequency is 108M, while STM32’s is 72M.

Using HSI (High-Speed Internal Clock): GD32’s maximum clock frequency is 108M, while STM32’s is 64M.

A higher clock frequency means faster code execution. If your project requires screen refreshing, square root calculations, motor control, etc., GD32 is a good choice.

3. Power Supply

External Power Supply: GD32’s external power supply range is 2.6~3.6V, while STM32’s is 2.0~3.6V or 1.65~3.6V. GD32’s power supply range is relatively narrower than that of STM32.

Core Voltage: GD32’s core voltage is 1.2V, while STM32’s is 1.8V. GD32’s core voltage is lower, resulting in lower power consumption during operation.

4. Flash Differences

GD32’s Flash is independently developed and differs from STM32’s.

GD Flash Execution Speed: GD32 Flash executes programs with 0 wait cycles.

STM32 Flash Execution Speed: The ST system frequency does not access Flash wait time relationships: 0 wait cycles when 0<SYSCLK<24MHz; 1 wait cycle when 24MHz<SYSCLK≤48MHz; 2 wait cycles when 48MHz<SYSCLK≤72MHz.

Flash Erase Time: GD32 takes longer to erase; the official data indicates that for GD32F103/101 series Flash models of 128KB and below, the typical Page Erase time is 100ms, with actual measurements around 60ms. In contrast, the corresponding ST product has a typical Page Erase time of 20~40ms.

5. Power Consumption

As shown in the table below, GD32’s power consumption is lower than STM32’s under the same clock frequency. However, under the same settings, GD32’s idle mode, standby mode, and sleep mode power consumption are still higher than STM32’s.

Differences Between STM32, GD32, and ESP32

6. Serial Communication

GD32 introduces a Bit Idle between every two bytes during continuous data transmission, while STM32 does not, as shown below:

Differences Between STM32, GD32, and ESP32

GD32’s serial communication has only 1/2 stop bit modes when sending, while STM32 offers 0.5/1/1.5/2 stop bit modes.

These differences in USART communication between GD32 and STM32 do not significantly affect communication, but GD32’s communication time will be slightly longer.

7. ADC Differences

GD32’s input impedance and sampling time settings differ from ST’s; with the same configuration, GD32’s input impedance tends to be lower. The specific situation is shown in the table below, running at a 72M clock frequency with an ADC sampling clock of 14M:

Differences Between STM32, GD32, and ESP32

8. FSMC

STM32 has FSMC only for large-capacity (256K and above) models with 100 pins or more, while GD32 has FSMC for all models with 100 pins or more.

9. Differences in RAM&FLASH Sizes for the 103 Series

The comparison of RAM and Flash sizes between GD103 series and ST103 series is shown in the image below:

Differences Between STM32, GD32, and ESP32

10. Differences Between 105&107 Series STM32 and GD

GD’s options for the 105/107 series are much more than ST’s; see the table below for details:

Differences Between STM32, GD32, and ESP32

11. Anti-Interference Ability

GD’s anti-interference ability is not as good as STM32’s and requires further refinement.

03

ESP32 and STM32

ESP32 is a chip launched by Espressif that features a dual-core system constructed with two Harvard architecture Xtensa LX6 CPUs. All on-chip memory, external memory, and peripherals are distributed across both CPUs’ data and/or instruction buses.

Compared to STM32’s extensive family, ESP32 also represents a series, but currently, the number of members in this series is relatively small. Let’s take a look:

Differences Between STM32, GD32, and ESP32

Resources are as follows:

Differences Between STM32, GD32, and ESP32
Differences Between STM32, GD32, and ESP32
Differences Between STM32, GD32, and ESP32

The functional block diagram is as follows:

Differences Between STM32, GD32, and ESP32

The pin distribution of the ESP32 module (not the chip) is as follows:

Differences Between STM32, GD32, and ESP32

The ESP32 module has limited IO, around 30 (the chip has 34, but some are used for external FLASH). However, it has several notable features:

1. It integrates many peripheral interfaces, including SPI, IIC, IIS, AD, DA, PWM, IR, UART, CAN, etc. Due to the limited number of IO, almost every IO has multiple functions.

2. The on-chip flash and RAM are substantial, with 448KB of flash and 520KB of RAM. Additionally, a 4MB flash is directly attached to the module.

3. It is fast! Although the external crystal frequency is only 40MHz, the internal clock can support 80MHz, 160MHz, and 240MHz, with a processing capability of up to 600MIPS.

4. It has WiFi and Bluetooth! However, both cannot be used simultaneously.

STM32 and ESP32 have distinctly different positioning. ESP32 is compact, fast, and powerful, designed for IoT connectivity through WiFi; while STM32 offers a rich pin count and comprehensive functionality, lacking WiFi and Bluetooth but capable of network connectivity through an Ethernet port, controlling more peripherals, catering to consumer electronics and industrial control.

04

Conclusion

STM32 and GD32 are homogenized products; one is foreign, and the other is domestic. With the recent trend towards domestic alternatives, GD32 has considerable development prospects.

The Internet of Things (IoT) is also a promising direction, hence ESP32 holds significant potential.

-END-
Previous Recommendations: Click on the images to read more

Differences Between STM32, GD32, and ESP32

Learn STM32 in 10 Days: A Summary of Learning Experiences

Differences Between STM32, GD32, and ESP32

Is There Any Toxicity in Soldering with a Soldering Iron?

Differences Between STM32, GD32, and ESP32

Is Computer Science the Next Civil Engineering?

Differences Between STM32, GD32, and ESP32

How Does a Crystal Oscillator Start Oscillating?

Leave a Comment