Which is better, STM32 Nucleo or ESP32? - Page 1
Forum section: electronics / general

author: vikranth47
author_rank: Newbie
timestamp: June 07, 2020, 10:52:02 am
content: I am looking to make some projects like rover, drone etc. And after i get comfortable, i might try other types of iot projects and machine learning projects.which mcu should i choose? i have already made some projects with arduino uno and esp8266, but some people have suggested to go with other dev boards. i did some research and it seems that stm32 nucleo is quite popular. but esp32 is also popular and has wifi and bluetooth, so i am kind of confused where to go next. i want good community support, modules availability and library support as i am a beginner and don't want to write libraries.should i stay with arduino ecosystem ,or go with stm, or both?

author: nuclearcat
author_rank: Unknown
timestamp: June 07, 2020, 12:04:45 pm
content: First you need to list all features you want. Comms, GPIO amount, PWM (max frequency, additional features you might need like dead time), ADC, etc.ESP32 have something unique - wifi, and it has mostly all features that regular MCU have. But ADC in it sucks big time (25Ksps vs 1Msps on normal MCU), maybe some other things too, especially amount of available GPIO.Also each STM32 model is different.You can keep using arduino with both, but try to pick more serious tools if your project become more than hobby.

author: poorchava
author_rank: Super Contributor
timestamp: June 07, 2020, 07:04:29 pm
content: STM32 Has a toolchain that works (to some extent) out of the box. With ESP32 you either have to use ARDUINO which has no debug and IDE worse than notepad or spent significant time to build a toolchain based on Eclipse and some sdk from Espressif (still no debug capability).Unless u need WiFi, go for STM32.

author: nuclearcat
author_rank: Unknown
timestamp: June 07, 2020, 07:28:54 pm
content: Quote from: poorchava on June 07, 2020, 07:04:29 pmESP32 have over 4MB flash, 400kb ram, and 2 core. It can print whole stack trace on console on crash.Also for beginner is much easier to run Arduino and few printf() than learning how to work with SWD/JTAG debugger and understand how things works on low level (inc. assembler), on particular architecture.This 2 platforms just have different debug approach.

author: lawrence11
author_rank: Frequent Contributor
timestamp: June 07, 2020, 07:29:36 pm
content: There is some second UART n the ESP-12S wich can output debug.You need 2 x debuggers.

author: ebclr
author_rank: Super Contributor
timestamp: June 07, 2020, 07:52:06 pm
content: This a very hard question, Does not exist the better processor, The thing who exists is what processor is better for one specific application / Development environment and even competition situation.The number of variables involved is enormous, You are looking for the price-performance in MIPS in one thing, You are looking for low energy consumption is another thing, Easy to develop another point, Flexibility of I/o another, Price another, Stability on supply another and many other variables I will not discuss hereIt's not an easy question.

author: vikranth47
author_rank: Newbie
timestamp: June 07, 2020, 08:10:13 pm
content: say, i want to make a drone, probably using an open source library like ardupilot. it will be a normal hobby drone with motors running on 12v battery.

author: nuclearcat
author_rank: Unknown
timestamp: June 07, 2020, 08:17:23 pm
content: Quote from: vikranth47 on June 07, 2020, 08:10:13 pmThen you will need to pick _board_ (and obviously MCU specific to this board) from list supplied by this library/software stack like ardupilot, unless you have time and skills to port this to new board.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 07, 2020, 08:38:31 pm
content: The esp32 has lots of RAM and flash and two cpu cores (*) and comes with a very nice FreeRTOS and lots of ready to use high-ish level libraries from expressif (ESP-IDF) and Arduino (built on top of espressif's FreeRTOS/IDF). Out of that ecosystem you'll find ~ nothing for the esp32.STM32 is the name of a (big) family of different µCs, only for a few of which you'll find readily available libraries, with a much more fragmented development ecosystem in which you'll have to go low level/bare metal most of the times.I like both, but I like the esp32 better. IMO the esp32 is a sort of "Rolls Royce" (fast and dual core and plenty of memory) of the current µCs, and don't forget that it can fit perfectly well in many sorts of projects even if you don't need the WiFi at all.(*) Three, really, if you count the ultra low power coprocessor.

author: vikranth47
author_rank: Newbie
timestamp: June 07, 2020, 09:21:17 pm
content: Quote from: nuclearcat on June 07, 2020, 08:17:23 pmhmm, the library has listed a few stm32 boards, i think i might go with stm32 f767zi

author: aheid
author_rank: Regular Contributor
timestamp: June 08, 2020, 03:00:22 am
content: There is a bit of overlap between them, but they also have several features each that set them apart.As such I'd learn both. Starting with the ESP32 if you are not familiar with microcontrollers already.

author: westfw
author_rank: Super Contributor
timestamp: June 08, 2020, 07:36:37 am
content: STM32 is a whole FAMILY of microcontrollers, ranging from small and very cheap to big and powerful. There is generally a "Nucleo" development board for a representative member of each family (62 different boards, according to digikey!) ESP32 is pretty much a single chip, available on a variety of board layouts (sometimes with different memory configurations, since the ESP32 uses external flash for program memory.)I'd say that ESP32 has more beginner-oriented libraries and frameworks (ie wireless internet by default), while the STM32s have more thorough low-level programmer-level documentation. (although Espressif seems to have gotten a lot better than it used to be.)

author: agehall
author_rank: Frequent Contributor
timestamp: June 08, 2020, 12:11:53 pm
content: Quote from: poorchava on June 07, 2020, 07:04:29 pmPlatformIO works for ESP32 AFAIK and then you can easily use VSC.

author: poorchava
author_rank: Super Contributor
timestamp: June 25, 2020, 08:19:57 am
content: Quote from: GeorgeOfTheJungle on June 07, 2020, 08:38:31 pmNot true. Cube code generator supports all chips in the family. Yes, the software generated in that way is usually not the smallest or highest performance, but usually does the job. Higher level stuff (USB, TCP, etc) often has bugs and/or some weird mechanics. You can always switch CUBE to LL (low level) for particular peripheral which gives you nice and lean C wrapper over bare metal. With Cortex-M cores you never really need to touch ASM, as they ar designed to be entirely programmable in C (including startup end such). If you see ASM in startup libs, then blame the lib provider for making their life harder than it needs to be.Most powerful chips in STM32 family are assymetric CM7@480MHz/CM4@240MHz and have shitload of RAM and FLASH. Some F7/H7 also come in "light" variety, which has very low flash (like 64k) but still 512k RAM (good for crunching numbers). I don't know how about ESP32, but CM7 cores have very high DMIPS/MHz ratio due to 6-stage pipeline with branch prediction. For example at the same clock rate CM4 vs CM7 in float 1024pt FFT, CM7 is almost 40% faster.

author: exe
author_rank: Unknown
timestamp: June 25, 2020, 08:34:39 am
content: Esp32 has wifi and micropython, which enabled me making simple prototypes lightning fast. I don't know if micropython has enough execution speed for real-time applications such as drones. There is an option to write performance-critical parts of the code in C, but I leave it up to you to decide if this suits you.Edit: stm32 => esp32

author: Psi
author_rank: Super Contributor
timestamp: June 25, 2020, 08:38:27 am
content: if you want to do anything outside of the norm the ESP will have you pulling your hair out a lot more than the stm32 will

author: nuclearcat
author_rank: Unknown
timestamp: June 25, 2020, 09:14:29 am
content: Quote from: Psi on June 25, 2020, 08:38:27 amFor example?(Just curious)

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 25, 2020, 10:09:28 am
content: Quote from: Psi on June 25, 2020, 08:38:27 amWhy do you say that? The documentation is excellent:https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/#introductionhttps://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 25, 2020, 10:15:32 am
content: Quote from: agehall on June 08, 2020, 12:11:53 pmAnd/or any other IDE you want, or none. Just have to install the toolchain:https://github.com/espressif/esp-idf

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 25, 2020, 10:30:32 am
content: Quote from: poorchava on June 25, 2020, 08:19:57 amBut you can buy an esp32 dev board for ~ $4. With a display! Name a dual core STM32 with WiFi and BT and enet MAC and 520k of RAM and up to 16MB of flash and up to 4(8?)MB of PSRAM for that price.On top of that with the esp-idf/FreeRTOS framework it takes 1/2 hour from scratch to having a WiFi access point with a http server running:https://github.com/espressif/esp-idf/tree/master/examples/protocols/http_serverAnd the JTAG debugger interface (esp-prog) is only $13:https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200625022510&SearchText=esp-progand super easy to setup and use with the platformio VSC extension (or with the Atom IDE):https://docs.platformio.org/en/latest/plus/debug-tools/esp-prog.html

author: MasterBuilder
author_rank: Regular Contributor
timestamp: June 25, 2020, 11:05:13 am
content: Quick answer: Just use the STM32I don't believe any professional user in the western world uses ESP32. The real question is what will be quicker/ easier to develop for you with least headaches. The conventional choice with the widest support base and knowledge is undoubtedly something from the ARM cortex M3 or M4 which covers the STM32 family of devices.

author: nuclearcat
author_rank: Unknown
timestamp: June 25, 2020, 11:20:46 am
content: Quote from: GeorgeOfTheJungle on June 25, 2020, 10:30:32 amThey are different. ESP32 has unique set of features and it is really brilliant for IoT, floating point is faster than STM32F7!, and i really use it in most of designs, but...You can't really expect fast and precise ADC on ESP32 (it is approx 25Ksps and it have lot of noise when Wifi is on) while on STM it is often 1Msps and more.You can't expect reliable RTC on ESP32 (but ULP can beat STM in matters of low power features).It needs separate flash and quite a bit passives, with RF compliance requirements and RF design constraints, because of this it is often useful as module only.Also esp32 SDK way too bloated (usual fate of software, if you want to support wifi + internet stuff with crypto), it will eat up usual 4MB flash in blink of eye, while on STM for 256Kb flash you can implement very complex realtime hardcore stuff.And many other things where esp32 can be better.But all that probably because there is no silver bullet possible in MCU market that suit every requirementStill, in most of common features it beats everybody.

author: Psi
author_rank: Super Contributor
timestamp: June 26, 2020, 12:50:23 pm
content: Quote from: GeorgeOfTheJungle on June 25, 2020, 10:09:28 amI was going on my experiences with the ESP8266. I probably should have said that in the post.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 26, 2020, 09:08:00 pm
content: Quote from: poorchava on June 25, 2020, 08:19:57 amIf you had these in mind:https://www.arduino.cc/pro/hardware/product/portenta-h7That's 90 euros !!!https://store.arduino.cc/portenta-h7TAXES NOT INCLUDED LOL

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: June 26, 2020, 09:18:14 pm
content: For that price I'd rather buy 5 sipeed maixduinos with 6MBRAM, 64bit dual core RISC-V @ 400..600MHz + esp32 + camera + TFT display:https://www.seeedstudio.com/Sipeed-Maixduino-Kit-for-RISC-V-AI-IoT-p-4047.htmlAnd the M1 module is only $9:https://www.seeedstudio.com/Sipeed-MAIX-I-module-WiFi-version-1st-RISC-V-64-AI-Module-K210-inside-p-3206.html

author: ucanel
author_rank: Regular Contributor
timestamp: June 26, 2020, 09:28:55 pm
content: If you have the courage to getting out of your comfort zone away from arduinoyou may select STM32H750 it is very cheap and way more powerful than esp32.If you want to stay in arduino ecosystem you may try portenta orsimilarly teensy 4.0 (it has also arm7 core but not from ST)

author: uer166
author_rank: Super Contributor
timestamp: June 26, 2020, 09:29:03 pm
content: I think you have to define the use case, is it for professional use? Is it for hobby to make some LEDs light up from a phone app?I've used both on good size projects, so I think I can compare the two. I will never touch ESP32 again, the massive amount of issues I found, some of which are:Absymal ADC performance, you lose the high and low endUnclear analog specificationsArduino dual core framework running the show is pretty opaqueSpent a week pulling my hair out on a crash that was caused by a flash write within an interrupt. Somewhere deep in documentation says that it impossible to do on ESP32. Excuse me what the fuck.Can't use half the pins safely because they are connected to the SPI flash, immediately running out of GPIOs/analog pinsUnclear real-time performaceCan't use ADC2 if you also have the WiFi enabled at the same time in the librariesTakes forever to boot since it has to load code into the RAM (may not matter realistically, but we are comparing with STM32 here)"Absolute maximum ratings" in the datasheet has 3 lines. Please explain how an engineer is supposed to design one of these into anything.The list goes on and on but the PTSD made me forget.Basically, the one and only embedded controls project I did on a ESP32 due to a customer requirement in Arduino framework made me never consider this platform ever again. As a WiFi co-processor? sure. As a core function MCU running the show? Hell. no. Stick to STM32 family, the options you have are massive, in terms of performance, functionality, ease of use, etc etc.

author: ucanel
author_rank: Regular Contributor
timestamp: June 26, 2020, 11:09:19 pm
content: Quote from: uer166 on June 26, 2020, 09:29:03 pmSimilar issue with Dspic30F6010, i beleive all other dspic pic24 and lower ones are have the same problem,you can not write to the eeprom memory in the interrupt routine.I have spent about nonstop 5 hours to find out that my problem caused by thiseven if i have known this issue before.You do not want to write to the flash or eeprom memoryin any of your intterrupt routines becauseit is time consuming and generally has its own interrupt states that writing is finished.

author: uer166
author_rank: Super Contributor
timestamp: June 26, 2020, 11:37:46 pm
content: Quote from: ucanel on June 26, 2020, 11:09:19 pmThat's a huge generalization, when writing to flash due to loss of power youwantit to be in an interrupt as the voltage rails are going down. dspic30 is a practically obsolete family, so irrelevant for this discussion. In any case my point was that ESP32 sucks in so many ways, its' widespread use is somewhat baffling to me.

author: robca
author_rank: Frequent Contributor
timestamp: June 27, 2020, 12:19:49 am
content: Quote from: poorchava on June 07, 2020, 07:04:29 pmMost people have already highlighted the strength and weaknesses of each.I just want to point out that with a <$10 FT2232L and Plaformio, you can do full HW debug on the ESP32, with a similar user experience as the STM32 (even using Arduino for the ESP32, or the native SDK). It uses SWD, and you can do just about anything, even if I prefer the Segger user experience on STM32 (which, depending on which board you use, might or might not be covered by the free license, even if there are quite a few "grey areas" uses of Segger and Segger on board working even on the cheap eBay ST Link clones, using a few tricks). But IDE and debugging is a complete draw, with no chip being better than the other in this respectIf you need BLE or WiFi, the ESP32 is massively convenient. If you read the documentation, you can run some pretty strict hard real time on the dual core even using Arduino. I managedto read 3 I2C sensors over 2 I2C buses at 400kHz bus speed and send data via BLE 500 times a second. Just the I2C timing takes most of that timing window, and could do it only thanks to the dual core architecture and RTOS. It was not easy to figure everything out, but once I did, it worked reliablyIf you need ADC/DAC, there are amazing STM32 chips (can do ADC at 10MSPS at 12bits), while the ESP32 is a sad joke when it comes to anything analogOn the other hand, if you want to build a drone/rover, with an ESP32 you don't even need a radio, there are plenty of examples of drones built with an ESP32 in the transmitter (or using a phone's wifi) and an ESP32 on the droneI routinely use both, and I like both, as long as I use them according to their strength for a scenario

author: mlewus
author_rank: Newbie
timestamp: March 11, 2021, 02:44:49 am
content: Quote from: poorchava on June 07, 2020, 07:04:29 pmPlatformio has great support for ESP32. You can use the ESP-IDF or Arduino frameworks, but with a decent editor, simple library version management, and debug support. Plus all the other features platformio brings to the table.The biggest issues I have with ESP 32 are it’s slow ADC, limited IO as implemented on common boards, and relatively slow bit bang rate compared to STM32. Power consumption (per “MIP”) is also higher. But you get wifi for “free” and integer performance is pretty good and you can’t beat the price. IMO it is a good, fast, low-cost alternative for many projects. if you need horsepower and cost is no issue, stick with an STM32F767.

author: ricard2k
author_rank: Unknown
timestamp: March 16, 2021, 04:57:14 pm
content: My particular experience is most on the ESP32 side. Coding with platformio is a good option, it supports hardware debugging. And if you want some seriously you have a good RTOS in your pipeline. Physically the STM32 ADC sucks, but in front of this you have WiFI and bluetooth support.I used STM32 with Keil and i didn't love it.

author: YurkshireLad
author_rank: Frequent Contributor
timestamp: March 16, 2021, 05:08:55 pm
content: Isn't the version of RTOS in PlatformIO really, really old?

author: ElektroHS
author_rank: Contributor
timestamp: March 16, 2021, 05:20:40 pm
content: Quote from: YurkshireLad on March 16, 2021, 05:08:55 pmPlatformio uses old version

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 16, 2021, 05:35:17 pm
content: Quote from: GeorgeOfTheJungle on June 26, 2020, 09:18:14 pmNah. There was already a lot of talk about the K210 on this forum. It's a nice chip, certainly, but unfortunately, there is basically no usable documentation and support is next to none. If you have tried to ask any tech question, you'll know. All you get to use it is some HAL which in itself is not bad, but it's badly documented as well and hasn't been updated in months now as far as I've seen (whereas it was actively maintained a year or two ago), so not a good sign either.If someone is hesitating between ESP32 and STM32, using the K210 doesn't seem to make any sense IMHO.

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: March 16, 2021, 10:10:11 pm
content: Also are you just using it to learn and play around with yourself or are you trying to make a commercial venture out of your efforts? I chose ESP32 as it was easy to get very fast with free shipping from Amazon in a day. When I look at STM32, the Amazon pricing wasn't as great for bang for buck features. Knowing the ADC wasn't the best internal one wasn't a factor as I had to ask myself if I was doing precision ADC work, I am not right at the moment and I also know I can get an ADC chip that far exceeds what you can get in uCs and just talk to it over data line from any uC to get values if I need precision work. The wireless was a big factor in my choosing it when adding up the cost of add-on boards for other uC options. It was like getting free 2.4GHz Wi-Fi, Bluetooth 4.2 and Bluetooth Low Energy radios to play with. From a programming perspective I don't "feel" any different what my uC is when running underlying programs. There are odd quirks or maybe function workarounds for each uC family for example on ESP32 for Analog output you use the ledcWrite(channel, dutycycle) function instead of what you are used to with Arduino. Outside of bumping into that you won't feel much different running on that platform. You have 3 cores (4 in other variants) to play with, Two Fast cores (some variants just one), and an Ultra Low Power core when the main cores are in one of the sleep modes. There is a new S3 variant coming out this year which I think has a state machine processing capability. So its a relatively big playground of toys to learn and play around with and comparatively uCs with a huge family of models are more highly segmented so you have to spend more mental analysis of the various families and models within the families to make sure you get what you need. Being a relatively tiny selection of models ESP32 is easier to get a big box of toys to play with. There is also an exotic for ESP32 variant the C3 which give you one fast core that is RISC-V based versus Tensilica Xtensa RX6/7 based. Other than dropping down to assembler to have a go at it, when most of your programming is in the C/C++ side you won't really again "feel" different. With the dual core variants the RTOS runs the I/O tasks on one core and for Arduino programs loads that onto the Second core so you get a full core to play with for program bandwidth not having to share it with other tasks. Once you get more advanced you can drop down to the Espressif IDF and take over both cores and the ULP if you wish.All that memory is an added plus, in addition to the Micro/Circuit Python options you also have AtomVM which gives you functional programming language to learn from if that tickles your fancy, and having the extra ram lets your own programs be larger in addition to storing AtomVM itself.Money wise it costs me more to order bluepills from China than ESP32-WROOM-32Ds from Amazon locally. Everyone's situation will vary. But that was also a factor in moving from ATMEL to ESP32 and bypassing bluepills which would sit in-between the two in performance.If I was doing it as a commercial venture then there would be a different set of criteria and not sure I'd have the same exact final decision as I would worry about supply-side factors and volume issues. But just playing around and having fun, its been a blast so far on ESP32. AFAIK all the sub-models do CAN except for not having to pay licensing fees some of their variants seem to list it as TWAI instead of CAN (Two Wire Automobile Interface).

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: March 16, 2021, 10:17:18 pm
content: To add to the manufacturers documentation you also have the excellent free/donation-ware Kolban's reference work on ESP32.https://leanpub.com/kolban-ESP32

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: March 16, 2021, 10:28:21 pm
content: Did a search, did not see it mentioned but with the $10 FT2232HL used as JTAG, I use this one with OpenOCD. Same chip is on the official Espressif Systems ESP-PROG board just they have the JTAG connectors and this one breaks out all the pins of the FT2232HL in case you want to multi-purpose the boards purchase over more than just ESP32 and being a multipurpose UART/FIFO IC I felt getting more bang for the buck would be nice so I skipped over ESP-PROG for one of these.You will get two serial outputs to play with so one can be used for JTAG while the other you can other-role how you would like.It also breaks out a ton of GPIO also available on the FT22343HL if you want something else to play with.

author: crossroad
author_rank: Contributor
timestamp: March 22, 2021, 06:18:43 pm
content: Pretty muchallof the flightcontrollers current available use STM32 ranging from F7 to F0, sometimes with H7. Software like ArduPilot, INAV, Betaflight/Cleanflight/Butterflight/Baseflight, and various others are designed to be compatible with STM32.The only exception I've found is the EagleTree Vector - uses a PIC32. However it's much more capable (features a beautiful vector OSD) than the open source symbol OSD that's so popular. EagleTree went out of business recently though, people aren't used to paying a premium for incredible softwareI personally like Matek Systems flight controllers - I own a few fixed wing and quad FCs from them. They could be good for reference design if you want to roll your own boardhttp://www.mateksys.com/?page_id=3834

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 22, 2021, 09:01:24 pm
content: Just an obvious point. ESP32 boards tend to have few IOs broken out, whereas Nucleo boards have a lot more (they come with 64-pin and 144-pin packages, with most IOs broken out.)So the number of IOs you need will also be a big factor.Now I don't know the whole ESP32 ecosystem, so if there's a board available that has as many IOs as even a Nucleo-64, do not hesitate to post a link.

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: March 22, 2021, 11:50:05 pm
content: There isn't a lot of ESP32 models to keep track of. GPIO started at 34 and with the latest is 45. If you get a development board with added components, sdcard, oled screens etc. then some of the GPIO will have been used for the extra hardware. The bog standard ESP32 was the "full fat" model and the other variants were various "reduced fat" versions, single core, etc. Not until the ESP32-S3 did a successor to the bog standard ESP32 appear. The launch video was released a few weeks back and goes over in short form the whole ESP ecosystem and the two new models, the RISC-V single core ESP32-C3 variant and the new ESP32-S3.Play time: 7 minuteshttps://youtu.be/AuO-pQbbZCE

author: erinic
author_rank: Newbie
timestamp: November 29, 2022, 06:58:27 am
content: 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.From: [ Attachment Invalid Or Does Not Exist ]

author: robca
author_rank: Frequent Contributor
timestamp: November 29, 2022, 05:17:53 pm
content: Quote from: erinic on November 29, 2022, 06:58:27 amSome STM32 are much faster than a ESP32, for example the STM32H7 at 480MHz will leave the ESP32 in the dust when it comes to pure execution and floating point performance. Power consumption, which is pretty fundamental for embedded, also varies a lotYou cannot truly compare a family of hundreds of devices with a wide range of size and power consumption, and more or less software compatible (STM32) to a small family of just 6 devices, mostly identical (ESP32)Neither is "better" than the other, it's all about how you want to use the device. I happily use both, depending on the project. Rarely there is a project where I'm undecided: if the project needs WiFi or Bluetooth, it's ESP32 (or, if just Bluetooth, possibly the nRF52 family). If it needs ethernet or no connectivity, usually STM32 is better. If it needs DAC or ADC, the ESP32 is really not an option

author: bidrohini
author_rank: Regular Contributor
timestamp: December 23, 2022, 06:40:20 am
content: It depends on your project's requirements. Memory sizes are different. So are the number of I/O pins.

author: paulca
author_rank: Super Contributor
timestamp: December 28, 2022, 11:52:31 am
content: Having deep dived into both the ESP32 and STM32 range recently.I would say. Use both. The ESP32 is a brilliant Wifi/BTLE modem and has a pretty decent processing core(s). It just doesn't really do much else that well. It's peripherals are significantly limited besides the 2.4Ghz 802 stacks.From the Espressif website you can download the basic AT Command Set firmware and just send and receive text commands and data through the ESP from a real MCU.The STM32 ranges tend to be much more established, extensive and coordinated.Consider the dev board of choice for getting into the STM32 would be the F411 Black Pill board. It's 100Mhz, 128K ram, 512Kb flash, but it has something like 4 hardware UARTS, 5 hardware SPI, 5 I2S audio with 2 of them full duplex, 16 channels of DMA. The ESPs have nothing like this.The Arduino framework exists on top of Espressifs IDF which is a massive RTOS based framework/os. The Arduino framework will pretend, limit and protect for only so long before you start working deeper and deeper into the IDF. It isn't that beginner friendly.STM32's can be a little more intimidating at first, but they have one of the most integrated and best established IDEs currently. CubeMX might not be perfect, it can be annoying but it is by far one of the most complete and functioning IDEs. The HAL libraries can be a bit hit and miss at times, but you get used to it's quirks pretty quickly. The ability to break and step through code, view variables, is an essential ability which will make learning to code the thing 100 times easier. Arduino frameworks are like coding with one eye closed. (Note, you can set up Eclipse to have the GDB debugger setup for ESP32, it's just you kinda have to set it all up yourself... and hope your ESP dev module exposes the right pins for the JTAC header.By putting both on a breadboard all of the this one or that one goes away.

author: robca
author_rank: Frequent Contributor
timestamp: December 28, 2022, 03:59:03 pm
content: Quote from: paulca on December 28, 2022, 11:52:31 amFor what is worth, ST provides full Arduino support for all STM32 chips/boards, and it's all well integrated into Platformio, including integrated debugging working out of the box. No need to deal with the rather horrendous Eclipse-based environmenthttps://github.com/stm32duinoit's based on the HAL implementation, so has a lot of abstraction and less than ideal performance, but it worksI agree that Arduino adds another abstraction level that hides too many things, but it's a great starting point for many. Personally, I hate the HAL implementation, and I try as much as possible to avoid using it. But it takes a lot more efforts than just loading STM32duino support into Platformio and have your code running and debugged in minutesYou make good points, and I mostly agree with you: if you want to really use these processors properly, you need to use either the IDF or STM32CubeIDE environments (incidentally, CubeMX is just the configurator, the full environment is STM32CubeIDE and that includes CubeMX). But for the average user, Platformio with ESP32 or STM32 support is a much better way to start

author: paulca
author_rank: Super Contributor
timestamp: December 28, 2022, 06:23:57 pm
content: The only reason I use PlatformIO is because it's better than the Arduino IDE. End of.It's extremely irritating as it's a Microsoft application. Designed by a committee of everyone BUT the user.Each to their own, but I like my IDEs fully functional, so Eclipse or JetBrains.

author: peter-h
author_rank: Super Contributor
timestamp: December 28, 2022, 06:47:56 pm
content: I would totally avoid a chinese CPU for aproductionproduct. Too much political risk.

author: paulca
author_rank: Super Contributor
timestamp: December 29, 2022, 12:59:38 pm
content: On the subject of "Nucleo" boards versus 3rd party dev boards.The Nucleos are fine, but the 64 and 144 versions are pretty difficult and awkward to use. They obviously don't fit breadboards and they have pins coming out the bottom AND the top. Meaning you have to be careful were you set it and it's just one big short and miss contact waiting to happen.They tend to have the advantage of a multi-enumerated USB port. So it gives you the STMLink programmer AND a VCOM Port UART connected to the boards UART2. The downside of the same is that the USB port is not easily available for use as a USB port. It requires jumpers and links to be modified I believe.The 3rd party boards like the Black Pill F411CE are much more compact, similar to the Nucleo 32s. 3rd party larger MCUs like the STM32H7 and F7 boards are available, usually with a working USB port (or two) and other goodies like 1Mb SRAM expansions and 16Mb flash etc.

author: nctnico
author_rank: Super Contributor
timestamp: December 29, 2022, 05:46:08 pm
content: Quote from: peter-h on December 28, 2022, 06:47:56 pmESP32 is made in Taiwan by TSMC. IMHO these are perfectly fine for a product. I'm about to use these for a project that needs BLE. I just hope that the BLE stack is production ready. Then again, Espressif has been on the market for a long time so the software has seen quite a bit of testing. And despite shortages, the ESP32 chips are available in enormous quentities.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 29, 2022, 07:01:38 pm
content: ESP32 stuff is good and very cheap, but you need to know the limitations. Among others, with no particular order:- Forget about developing using anything else than their provided SDK and tools. Low-level documentation is far too limited (or even non-existent for the radio stuff) to be able to use them efficiently with a "baremetal" approach. Can be a problem for some.- Their low-power modes are also very limited, if power consumption is an issue. In particular for battery-operated stuff. If you need a "deep sleep" mode with current draw in the µA range, then they do have a deep sleep mode indeed and will draw a few µA if configured right. Problem is that, contrary to many other MCUs with such modes, the wake up from deep sleep doesn't get you back where code was when it entered deep sleep. The only way it wakes up is a full reboot, which takes a few 100's of ms. Mind-boggling. This is so for the ESP32-C3, I can't say for sure it is for the whole ESP32 line, but I suspect so. Could be a very problematic point.

author: peter-h
author_rank: Super Contributor
timestamp: December 30, 2022, 03:13:48 pm
content: A colleague (in another firm) is working on an ESP32 based project. He also works a bit on my current one (32F417) which he initially set up (Cube, FreeRTOS, LWIP. FatFS, MbedTLS).He doesn't post on forums but his view could be summarised as- ESP32 is much more usable package for the above sw combination (they apparently picked up one "know it all" character from some forum and paid him to do it)- ST supplied ports of these modules are quite painful (probably half a man-year was spent on making them work especially LWIP+ETH and USB VCP - CDC/MSC)- ESP32 is right now much more available but does come with some political risk (a china-controlled vendor?)- The ST port of MbedTLS is more or less useless for host authentication (handling of the ~200k root cert file needs mods (on github) which took a lot of time to put in; I don't know if the ESP32 has the same issue, and it doesn't matter if you are calling up a private server and thus using just a single cert. MbedTLS is a massive ~200k+ lump which needs loads of RAM.- ESP32 uses TinyUSB which has bugs also and some very subtle ones- he might be doing BT and WIFI; I don't know but I would expect these to be painful on ST unless a module was used (a good idea actually for EMC approvals)It's a good Q as to why my project went down the ST route. I think it is because it was started in 2016 and back then there were few other options. And Cube MX makes it easy to get started with a simple running system quickly. Also now I would not use any chinese chip as a key component.

author: tooki
author_rank: Super Contributor
timestamp: May 04, 2023, 11:38:31 am
content: Quote from: paulca on December 28, 2022, 06:23:57 pmJust a clarification: PlatformIO is NOT a Microsoft product. PlatformIO can be used on its own via the command line, but is most commonly used as an extension to Visual Studio Code (which is a Microsoft product, though it’s open source, and there are forks of it). But there are also other graphical IDEs that PlatformIO can be installed into.

author: barshatriplee
author_rank: Regular Contributor
timestamp: May 08, 2023, 06:09:33 am
content: Both are good. The choice depends on your application.

author: eTobey
author_rank: Super Contributor
timestamp: May 10, 2023, 08:52:33 am
content: I find the documentaion on the STM lacking quite a few details. Also you have to look into at least 3 Datasheets. It has some libraries to get into, but they become quickly annoying (at least for me). The good thing is the debugger, and you will definately need that...

author: robca
author_rank: Frequent Contributor
timestamp: May 10, 2023, 04:50:01 pm
content: Quote from: eTobey on May 10, 2023, 08:52:33 amST provide 2 datasheet per processor, one is the reference manual and another is the datasheet. The datasheet is specific to a processor version (e.g. STM32F411xC STM32F411xE) and the reference for all the family (STM32F411). As a programmer, usually the reference manual is all you need. At >700 pages for the reference manual, they provide some of the best docs available in the embedded space. Those are complex processor, and each peripheral has a lot of optionsThen ST provides 2 different set of libraries. The LL, low level library, is the one to use and is mostly well written, reflecting the processor registers. On top of the LL, ST provides a mess called HAL. The HAL is messy, redundant, slow, cumbersome and pointless. In theory, it abstracts peripherals for all devices, in reality you need different HAL calls for the same peripheral on different processors. It adds all the crud of an abstraction layer, with none of the benefits. It's painfully slow and memory intensive, and hard to debug.As long as you read the reference manual and use the LL libraries (STM32Cube can generate LL code if you check the proper boxes), STM32 processors are easy to use and well documented. The LL libraries just make it easier to use the peripheral registers and add value. Just stay away from the HAL as much as you can (you need it for some things like the USB, but you can generate LL code for everything else, and use HAL only for the USB)There are also alternatives like mbed, and LibOpenCM3 (not for every processor).

author: grantb5
author_rank: Regular Contributor
timestamp: May 18, 2023, 10:49:29 pm
content: Quote from: nctnico on December 29, 2022, 05:46:08 pmThat's the foundry. The company is Chinese.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 18, 2023, 10:56:12 pm
content: Quote from: grantb5 on May 18, 2023, 10:49:29 pmYes. Almost everyone uses TSMC these days for the advanced CMOS processes anyway. That says nothing about the quality of the product.As to the shortage, in case people haven't noticed, the chinese semiconductors have tended to have much better availability than their western counterparts. They are also much cheaper. News at 11.

author: grantb5
author_rank: Regular Contributor
timestamp: May 19, 2023, 01:05:02 pm
content: Yes, definitely cheaper. I have found the STM32 U5 line in stock in most places and it's pretty cheap considering all the advanced peripherals it has. I am not using it yet, but it is definitely on my radar.

author: paulca
author_rank: Super Contributor
timestamp: May 19, 2023, 05:49:47 pm
content: Someone on this forum referred to the ESP32 as a "clone" of the STM32.I figured this person has only used one of the above.The ESP is a Wifi comms module which happens to have more core performance than it needs for 90% of pure "Comms module" requirements. So, if you add some flash and/or ram it makes a brilliant "Maker class" Wifi/BLE MCU. Almost perfect.The reality is, if you switch on all of the built in features for Wifi and Bluetooth, including all the encryption and tunnelling protocols it supports, there won't be much left of those cores for your blinky.