7
\$\begingroup\$

I am currently choosing a processor for my embedded robotics project. I have just completed a prototype with the ESP32 DEVKIT-V1 module.

I hope to commercialize my product in the future, however, when looking at professional boards, I mainly see STM32s being used and no ESP32s.

Why is this the case, even though ESP32 has better performance (clock speed, RAM, flash size, etc.) than most STM32s?

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Does ESP32 have a progressive line-up of parts and is it as well supported? I'd ask about reliability of supply too but that's shot right now. \$\endgroup\$
    – DKNguyen
    Mar 24, 2022 at 14:37
  • 5
    \$\begingroup\$ So what if most STM32 models are slower and have less memory? You are comparing apples to oranges and they don't compare. There are also STM32 models that are faster and have more memory so a counter question is why would anyone use ESP32 at all if only memory and speed are concerned. You select something for the job that is enough, and that is different from the question if ESP32 can be used in a commercial product. Yes it can and it has nothing to do with other products using STM32. \$\endgroup\$
    – Justme
    Mar 24, 2022 at 14:58
  • 2
    \$\begingroup\$ Apparently a lot of the pre-made boards for ESP32 are of questionable quality, judging by EMC-related questions about them posted here. You should probably start there: will you CAD the board yourself or buy something pre-made? \$\endgroup\$
    – Lundin
    Mar 24, 2022 at 15:37
  • \$\begingroup\$ @Lundin - thank you for your reply. I will be designing my own board. \$\endgroup\$
    – Tony
    Mar 24, 2022 at 15:39
  • 3
    \$\begingroup\$ Anyway, chose MCU based on your project requirements, not based on some whim. For example if you have a requirement to have misc wireless peripherals on-chip, then that's a specialised requirement which will narrow down your options quite a bit. Things like clock speed and memory size are among the last things to look for, they can easily be up/down scaled. \$\endgroup\$
    – Lundin
    Mar 24, 2022 at 15:41

3 Answers 3

14
\$\begingroup\$

The ESP32 is a viable commercially made product and is widely used both by experimenters and in production of commercially made products.

The ESP32 has quite a bit more functionality (i.e. BT and WiFi) than the bare STM32 but many variations of the STM32 may be less expensive. The STM32 also usually has more internal peripherals.

The two are both microcontrollers and therefore have many similarities but they are neither the same nor interchangeable.

If I had designed a product prototype using the ESP32 I would not have any reservations on using it in production provided its cost and availability met the requirements needed there.

\$\endgroup\$
8
  • \$\begingroup\$ What's a "bare STM32"? There's literally thousands of them with all manner of different cores and peripherals. \$\endgroup\$
    – Lundin
    Mar 24, 2022 at 15:38
  • 3
    \$\begingroup\$ To my knowledge none of them have built in BT or WiFi. So you need to add external components to accomplish this. \$\endgroup\$
    – jwh20
    Mar 24, 2022 at 15:39
  • 6
    \$\begingroup\$ I was merely pointing out some differences. \$\endgroup\$
    – jwh20
    Mar 24, 2022 at 16:06
  • 2
    \$\begingroup\$ STM32W series are "bare" micros with built-in radios supporting BLE, IEEE-802.15.4, Lora, etc. \$\endgroup\$
    – brhans
    Mar 24, 2022 at 17:47
  • 1
    \$\begingroup\$ espressif.com/en/news/… \$\endgroup\$
    – jwh20
    Mar 25, 2022 at 14:09
12
\$\begingroup\$

Both the ESP32 and STM32 can be used in commercial applications, like any commercially available MCU. It all depends on your requirements, such as:

  1. Do you need Wi-Fi?
  2. Do you need Bluetooth?
  3. Do you need to reduce board space (physical requirement)?
  4. What internal peripherals do you need? How many communication interfaces? How many pins? How many ADC channels with which resolution? Do you need some feature that is specific of one CPU line?
  5. How much program space and RAM do you need (approximate, if you are early in the design process)? Does the CPU line have footprint compatibility so that you can downscale the component at the end of the design phase, to save on component costs?
  6. Do you have realtime requirements? How many cores do you need? How many cores does each CPU have? Do you want to spend time of your cores managing Wi-Fi? Does the SDK hide RTOS details? If your SDK uses a RTOS to manage Wi-Fi, how does that affect your realtime requirements?
  7. Do you have low-energy requirements? How does each CPU fare on the projections for your application?
  8. What is your current project status? If the product is already designed, do you want to spend the resources to port it to another CPU?
  9. What's the cost of each CPU (total BOM cost including support components, assembly cost, etc)?
  10. Are they easy to source in the volume you need?
  11. How is their SDK and library support? Can you design with both? Does learning another toolchain affect your Time-to-market? Did you actually set time-to-market requirements?
  12. What are the costs for the MVP using both, provided your other requirements allow usage of both?

You have to research some of these points to choose in an early stage of development. If, like the OP, you are already in prototype stage, the cost of porting will most likely dominate over other aspects of the product.

\$\endgroup\$
3
\$\begingroup\$

As a firmware engineer who's been professionally developing firmware for STM32 microcontrollers (and never touched the ESP MCUs), I recommend you to do the following features comparison between the two before switching from STM32 to ESP32:

  1. How long is the particular ESP32 chip going to be in production? ST provides a 10-year longevity commitment for their microcontrollers, which is perfect for commercial products: https://www.st.com/content/st_com/en/about/quality-and-reliability/product-longevity.html#10-year-longevity
  2. What do the development tools look like and how easy are they to use and what platform do they run on? ST provides CubeMx and Eclipse-based CubeIDE that support automatic code generation, include configurable HAL library etc. These tools run on Windows/Mac/Linux, so you have plenty of choices. The included GCC compiler toolchain is well-supported by community and there is plenty of well-written documentation, including official user guides, application notes and manuals from ST to support their tools.
  3. Debug tool support. As STM32 MCUs are based on the Arm CPU core, this core has a proven track record of being power efficient (due to support for sleep states) and easy to debug. As for debugging, Arm supports SWD and JTAG (SWD being faster of the two), they support hardware breakpoints, SWO debug trace functionality for things like debug output of debug information (like using printf in C) and for function runtime profiling.
  4. RTOS support. Many RTOS's have been ported to support Arm CPU cores. Not sure what support the ESP core has received from, say, FreeRTOS or Zephyr RTOS.
  5. Low power state support. Besides the low power states built into the CPU core, STM32 MCUs support other proprietary low power states that might be important for battery-powered applications. Not sure what functionality ESP32 provides in this area.
  6. Example library. The official example library on GitHub is very extensive for STM32. I would assume that ESP provides something similar, but I would have to research it further to see how it compares.
  7. Documentation. ST provides extensive documentation covering all parts of their MCUs in great detail. The documentation is frequently updated, including errata sheets containing details about what doesn't work and suggested workarounds. MCU silicon is often revised if a problem is found and new versions are released to correct a known issue. Not sure how Espressif addresses their MCU issues.
  8. Field support. ST, depending on the level of service your company has signed up for, will provide field support, such as assigning their engineers to helping you with particular issues, even if you're working with a custom board design.
  9. Dedicated forums. ST has a dedicated community forum where people share issues and solutions. It's very helpful and has allowed me to resolve many problems I personally encountered: https://community.st.com/t5/stm32-mcus-products/bd-p/stm32-mcu-products-forum
\$\endgroup\$
3
  • \$\begingroup\$ Michael Ansolis - Hi, Regarding your statement that "{you would} be curious to see how the following features compare". Can you please clarify: (a) Are you asking the questions you listed, i.e. is this a question of your own and you want answers to these questions? Or: (b) Are you recommending to the OP that these are the questions they should investigate themselves, and you don't actually need the answers to these questions yourself? Which applies here, (a) or (b)? Thanks. \$\endgroup\$
    – SamGibson
    Nov 19, 2023 at 21:49
  • 1
    \$\begingroup\$ @SamGibson My comment simply recommends things to consider when deciding whether ESP32 can be used in commercial applications. I know only about STM32 products and why they have wide use in commercial applications. If someone came to me and asked me why can't we used ESP32, I'd point them to my list above and told them that I'd have to consider all those things (at a minimum) before making the switch. \$\endgroup\$ Nov 19, 2023 at 22:27
  • 1
    \$\begingroup\$ Michael Ansolis - Thanks for your reply. That has clarified that you are not asking questions here that you want the reply to (my option (a)) and that you mean my option (b). || That is important, as option (a) is not allowed in an answer as you posted. We do get lots of new users here who ask questions as answers, treating the site as a typical linear forum. Hence I wanted to clarify that you are not looking for answers to those questions, but you intend other people to consider them (a kind of socratic approach, therefore), Another user has kindly edited your answer to make that clear. \$\endgroup\$
    – SamGibson
    Nov 19, 2023 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.