STM32 vs ESP32 for Embedded Projects: How Do You Choose?

I’ve been working on embedded projects and exploring both STM32 and ESP32 development using PlatformIO. Both are useful platforms, but choosing between them depends on the project requirements.

For example, the ESP32 is convenient for projects that need built-in Wi-Fi or Bluetooth, such as IoT devices and remote monitoring systems. STM32 is also a strong option for applications that need precise peripheral control, real-time processing, or integration with different communication interfaces.

I’m curious how others make this decision when starting a new project.

  • When would you choose STM32 over ESP32, or the other way around?

  • How has your experience been managing both platforms in PlatformIO?

  • Do you find the debugging and library management workflow different between the two?

  • For projects involving sensors, UART, SPI, I²C, or Ethernet, what factors influence your choice?

I’d be interested to hear about your experience with real projects, especially any limitations or unexpected challenges you’ve encountered when moving from a prototype to a more complete embedded system.