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

0 Members and 1 Guest are viewing this topic.

Offline vikranth47Topic starter

  • Newbie
  • Posts: 3
  • Country: in
Which is better, STM32 Nucleo or ESP32?
« on: June 07, 2020, 10:52:02 am »
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?
 

Offline nuclearcat

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #1 on: June 07, 2020, 12:04:45 pm »
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.
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1672
  • Country: pl
  • Troll Cave Electronics!
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #2 on: June 07, 2020, 07:04:29 pm »
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.
I love the smell of FR4 in the morning!
 
The following users thanked this post: hans, denimdragon

Offline nuclearcat

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #3 on: June 07, 2020, 07:28:54 pm »
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.
ESP32 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.
 

Offline lawrence11

  • Frequent Contributor
  • **
  • Posts: 321
  • Country: ca
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #4 on: June 07, 2020, 07:29:36 pm »
There is some second UART n the ESP-12S wich can output debug.

You need  2 x debuggers.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #5 on: June 07, 2020, 07:52:06 pm »
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 here

It's not an easy question.
 

Offline vikranth47Topic starter

  • Newbie
  • Posts: 3
  • Country: in
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #6 on: June 07, 2020, 08:10:13 pm »
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.
 

Offline nuclearcat

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #7 on: June 07, 2020, 08:17:23 pm »
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.
Then 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.
« Last Edit: June 07, 2020, 08:22:14 pm by nuclearcat »
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #8 on: June 07, 2020, 08:38:31 pm »
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.
« Last Edit: June 07, 2020, 08:41:50 pm by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline vikranth47Topic starter

  • Newbie
  • Posts: 3
  • Country: in
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #9 on: June 07, 2020, 09:21:17 pm »
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.
Then 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.

hmm, the library has listed a few stm32 boards, i think i might go with stm32 f767zi
 

Offline aheid

  • Regular Contributor
  • *
  • Posts: 245
  • Country: no
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #10 on: June 08, 2020, 03:00:22 am »
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.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #11 on: June 08, 2020, 07:36:37 am »
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.)
 

Offline agehall

  • Frequent Contributor
  • **
  • Posts: 383
  • Country: se
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #12 on: June 08, 2020, 12:11:53 pm »
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).

PlatformIO works for ESP32 AFAIK and then you can easily use VSC.
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1672
  • Country: pl
  • Troll Cave Electronics!
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #13 on: June 25, 2020, 08:19:57 am »

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.

(*) Three, really, if you count the ultra low power coprocessor.

Not 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.
I love the smell of FR4 in the morning!
 

Offline exe

  • Supporter
  • ****
  • Posts: 2562
  • Country: nl
  • self-educated hobbyist
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #14 on: June 25, 2020, 08:34:39 am »
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
« Last Edit: November 29, 2022, 10:36:50 am by exe »
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9951
  • Country: nz
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #15 on: June 25, 2020, 08:38:27 am »
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
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline nuclearcat

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #16 on: June 25, 2020, 09:14:29 am »
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
For example?
(Just curious)
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #17 on: June 25, 2020, 10:09:28 am »
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

Why do you say that? The documentation is excellent:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/#introduction
https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #18 on: June 25, 2020, 10:15:32 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).

PlatformIO works for ESP32 AFAIK and then you can easily use VSC.

And/or any other IDE you want, or none. Just have to install the toolchain: https://github.com/espressif/esp-idf
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #19 on: June 25, 2020, 10:30:32 am »
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.

But 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_server

And the JTAG debugger interface (esp-prog) is only $13: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200625022510&SearchText=esp-prog and 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

The further a society drifts from truth, the more it will hate those who speak it.
 
The following users thanked this post: larsdenmark

Offline MasterBuilder

  • Regular Contributor
  • *
  • Posts: 86
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #20 on: June 25, 2020, 11:05:13 am »
Quick answer: Just use the STM32

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

Offline nuclearcat

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #21 on: June 25, 2020, 11:20:46 am »

But 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_server

And the JTAG debugger interface (esp-prog) is only $13: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200625022510&SearchText=esp-prog and 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
They 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 requirement :)
Still, in most of common features it beats everybody.
 
The following users thanked this post: GeorgeOfTheJungle, Jacon

Online Psi

  • Super Contributor
  • ***
  • Posts: 9951
  • Country: nz
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #22 on: June 26, 2020, 12:50:23 pm »
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

Why do you say that? The documentation is excellent:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/#introduction
https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf

I was going on my experiences with the ESP8266.  I probably should have said that in the post.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #23 on: June 26, 2020, 09:08:00 pm »
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.

If you had these in mind: https://www.arduino.cc/pro/hardware/product/portenta-h7

That's 90 euros !!!

https://store.arduino.cc/portenta-h7

TAXES NOT INCLUDED LOL  :-DD
« Last Edit: June 26, 2020, 09:19:56 pm by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Which is better, STM32 Nucleo or ESP32?
« Reply #24 on: June 26, 2020, 09:18:14 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
« Last Edit: June 26, 2020, 09:26:08 pm by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf