Author Topic: Which is better, STM32 Nucleo or ESP32?  (Read 33749 times)

0 Members and 1 Guest are viewing this topic.

Offline ucanel

  • Regular Contributor
  • *
  • Posts: 134
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #25 on: June 26, 2020, 09:28:55 pm »
If you have the courage to getting out of your comfort zone away from arduino
you 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 or
similarly teensy 4.0 (it  has also arm7 core but not from ST)
 
The following users thanked this post: grantb5

Offline uer166

  • Frequent Contributor
  • **
  • Posts: 890
  • Country: us
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #26 on: June 26, 2020, 09:29:03 pm »
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 end
  • Unclear analog specifications
  • Arduino dual core framework running the show is pretty opaque
  • Spent 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 pins
  • Unclear real-time performace
  • Can't use ADC2 if you also have the WiFi enabled at the same time in the libraries
  • Takes 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.

 
The following users thanked this post: balun, delad

Offline ucanel

  • Regular Contributor
  • *
  • Posts: 134
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #27 on: June 26, 2020, 11:09:19 pm »

...Spent 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.

Similar 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 this
even if i have known this issue before.

You do not want to write to the flash or eeprom memory
in any of your intterrupt routines because
it is time consuming and generally has its own interrupt states that writing is finished.
 
The following users thanked this post: GeorgeOfTheJungle

Offline uer166

  • Frequent Contributor
  • **
  • Posts: 890
  • Country: us
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #28 on: June 26, 2020, 11:37:46 pm »
You do not want to write to the flash or eeprom memory
in any of your intterrupt routines because
it is time consuming and generally has its own interrupt states that writing is finished.

That's a huge generalization, when writing to flash due to loss of power you want it 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.
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #29 on: June 27, 2020, 12:19:49 am »
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.
Most 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 respect

If 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 managed
 to 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 reliably

If 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 analog

On 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 drone

I routinely use both, and I like both, as long as I use them according to their strength for a scenario
 
The following users thanked this post: edavid, GeorgeOfTheJungle, exe, tooki, nuclearcat

Offline mlewus

  • Newbie
  • Posts: 3
  • Country: us
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #30 on: March 11, 2021, 02:44:49 am »
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.
Platformio 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.
 

Offline ricard2k

  • Supporter
  • ****
  • Posts: 17
  • Country: ie
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #31 on: March 16, 2021, 04:57:14 pm »
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.
 

Offline YurkshireLad

  • Frequent Contributor
  • **
  • Posts: 365
  • Country: ca
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #32 on: March 16, 2021, 05:08:55 pm »
Isn't the version of RTOS in PlatformIO really, really old?
 

Offline ElektroHS

  • Contributor
  • Posts: 27
  • Country: sk
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #33 on: March 16, 2021, 05:20:40 pm »
Isn't the version of RTOS in PlatformIO really, really old?

Platformio uses old version
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14471
  • Country: fr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #34 on: March 16, 2021, 05:35:17 pm »
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.html

And 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

Nah. 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.
 

Offline GodIsRealUnless DefinedInt

  • Contributor
  • Posts: 42
  • Country: us
  • The Implicit None
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #35 on: March 16, 2021, 10:10:11 pm »
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).
 

Offline GodIsRealUnless DefinedInt

  • Contributor
  • Posts: 42
  • Country: us
  • The Implicit None
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #36 on: March 16, 2021, 10:17:18 pm »
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
 

Offline GodIsRealUnless DefinedInt

  • Contributor
  • Posts: 42
  • Country: us
  • The Implicit None
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #37 on: March 16, 2021, 10:28:21 pm »
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.
« Last Edit: March 16, 2021, 10:30:46 pm by GodIsRealUnless DefinedInt »
 

Offline crossroad

  • Contributor
  • Posts: 26
  • Country: us
  • Avian World Theory
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #38 on: March 22, 2021, 06:18:43 pm »
Pretty much all of 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 software

I 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 board http://www.mateksys.com/?page_id=3834

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14471
  • Country: fr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #39 on: March 22, 2021, 09:01:24 pm »
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.
 

Offline GodIsRealUnless DefinedInt

  • Contributor
  • Posts: 42
  • Country: us
  • The Implicit None
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #40 on: March 22, 2021, 11:50:05 pm »
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 minutes
https://youtu.be/AuO-pQbbZCE
 

Offline erinic

  • Newbie
  • !
  • Posts: 4
  • Country: england
    • https://www.veswin.com/
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #41 on: November 29, 2022, 06:58:27 am »
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 ]
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #42 on: November 29, 2022, 05:17:53 pm »
and the speed is not as fast as ESP32
Some 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 lot

You 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
 
The following users thanked this post: hans, tellurium

Offline bidrohini

  • Regular Contributor
  • *
  • Posts: 201
  • Country: bd
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #43 on: December 23, 2022, 06:40:20 am »
It depends on your project's requirements. Memory sizes are different. So are the number of I/O pins.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #44 on: December 28, 2022, 11:52:31 am »
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.
« Last Edit: December 28, 2022, 11:54:53 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #45 on: December 28, 2022, 03:59:03 pm »
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.
For 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 environment :)  https://github.com/stm32duino it's based on the HAL implementation, so has a lot of abstraction and less than ideal performance, but it works

I 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 minutes

You 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
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #46 on: December 28, 2022, 06:23:57 pm »
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.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: gb
  • Doing electronics since the 1960s...
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #47 on: December 28, 2022, 06:47:56 pm »
I would totally avoid a chinese CPU for a production product. Too much political risk.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: grantb5

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #48 on: December 29, 2022, 12:59:38 pm »
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.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #49 on: December 29, 2022, 05:46:08 pm »
I would totally avoid a chinese CPU for a production product. Too much political risk.
ESP32 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf