How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
https://youtu.be/337rDuCGeYs
How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
Informative, but maybe no great surprises until the Teensy4.1 ... little rocket, it is.
The ESP32 FreeRTOS integration under Arduino is well done. Creating and distributing tasks between CPU0 and CPU1 is extremely easy:
https://www.hackster.io/rayburne/esp32- ... res-8dd948
What was not shown in the YouTube is the power dissipation per MIP. The ESP8266 can easily have the RF section turned-off to conserve power, but I have not personally verified doing the same with the ESP32.
https://www.hackster.io/rayburne/esp826 ... ime-1df8ae
Other issues to consider, because MIPS is simply a poor comparison choice IMO, is SRAM and flash storage and SPIFFs. (There seems to be some github efforts around SPIFFS for STM32 but I have not investigated the maturity.) For ESP8266, SPIFFs works as advertised and is a no-brainer for look-up tables:
https://www.hackster.io/rayburne/oui-ou ... 266-323ae4
BUT
The "right" uC is the one that fits your project requirements; speed is a very poor choice as the primary attribute of hardware selection. Design and hardware selection is not a guess, rather it is an informed decision with engineering principles applied to the choices.
Understand that increasing the clocking increases the power consumed and the heat that must be dissipated. For battery powered projects, wasted clock cycles is notoriously wasted work at the expense of battery life.
Note that 8-bit uCs are not dead and are an excellent choice for some projects.
WiFi chips can often be excellent general purpose uC's if one disable the radio module.
SPIFFs can be a tie breaker between uC selection; especially in look-up table applications.
Espressif analog performance and available analog ports should be carefully reviewed before uC selection.
The ESP32 FreeRTOS integration under Arduino is well done. Creating and distributing tasks between CPU0 and CPU1 is extremely easy:
https://www.hackster.io/rayburne/esp32- ... res-8dd948
What was not shown in the YouTube is the power dissipation per MIP. The ESP8266 can easily have the RF section turned-off to conserve power, but I have not personally verified doing the same with the ESP32.
https://www.hackster.io/rayburne/esp826 ... ime-1df8ae
Other issues to consider, because MIPS is simply a poor comparison choice IMO, is SRAM and flash storage and SPIFFs. (There seems to be some github efforts around SPIFFS for STM32 but I have not investigated the maturity.) For ESP8266, SPIFFs works as advertised and is a no-brainer for look-up tables:
https://www.hackster.io/rayburne/oui-ou ... 266-323ae4
BUT
The "right" uC is the one that fits your project requirements; speed is a very poor choice as the primary attribute of hardware selection. Design and hardware selection is not a guess, rather it is an informed decision with engineering principles applied to the choices.
Understand that increasing the clocking increases the power consumed and the heat that must be dissipated. For battery powered projects, wasted clock cycles is notoriously wasted work at the expense of battery life.
Note that 8-bit uCs are not dead and are an excellent choice for some projects.
WiFi chips can often be excellent general purpose uC's if one disable the radio module.
SPIFFs can be a tie breaker between uC selection; especially in look-up table applications.
Espressif analog performance and available analog ports should be carefully reviewed before uC selection.
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
It's a very good video but I think that Andreas isn't really familiarized enough with the STM32 platform, for example, he didn't mention that add support for a "not listed" MCU it's super-easy on the ST core and he says that if an MCU/board isn't listed there is not support for it, also I always use those cheap ST link clones on arduino ide, maybe his st link needs a firmware update?
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
I saw this video when it appeared on my RSS feed last Sunday. It was a pretty good overview.
I flashed a couple of them with the Micronucleus (Digispark) bootloader so I could use USB.
True, I have a tube of ATTiny85s that are quite useful for small projects. It is surprising at the amount of code that will fit into one of these.Note that 8-bit uCs are not dead and are an excellent choice for some projects.
I flashed a couple of them with the Micronucleus (Digispark) bootloader so I could use USB.
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
Arduino Analog ---> Excel on PCfredbox wrote: Sat Sep 26, 2020 5:16 pm ...
I flashed a couple of them with the Micronucleus (Digispark) bootloader so I could use USB.
Trinket clone:
https://www.hackster.io/rayburne/chachk ... one-c644a9
https://forum.arduino.cc/index.php?topi ... msg1387322
Pro Trinket clone:
https://www.hackster.io/rayburne/tchotc ... one-494058
DigiSpark clone: https://www.hackster.io/rayburne/trinke ... ism-f1f490
Frank Zhao is the father of the Trinket project: https://www.slashgear.com/frank-zhao-cr ... -05112690/
Frank's inspiration was the remarkable V-USB project: https://www.obdev.at/products/vusb/index.html
One rather interesting use of the tiny85: 1-second timer
Low-power mode
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
as for myself, STM32 is still my fad as i'm kind of lazy to learn another mcu, but i'd guess i'd checkout the esp32 soon 
i'd guess STM32 is good for the things it is good at while ESP32 is good for the things it is good at e.g. wifi embedded.
STM32's DMA is very hard to beat where it comes to IO performance, for applications that fit the use case

i'd guess STM32 is good for the things it is good at while ESP32 is good for the things it is good at e.g. wifi embedded.
STM32's DMA is very hard to beat where it comes to IO performance, for applications that fit the use case
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
on another note if you watch the video, you can see the performance of the F4 FPU, in single precision mode in which FPU is effective it out performs all the others compared. Frankly, this is an underutilized feature on the F4.
I've been thinking about using this feature in 'sensor' use cases, a coil of copper wire is just a coil until you calibrated it, then it can be used to detect magnetic fields, changing currents, etc. so do many other 'sensors' like a simple photo diode or photo transistor. the main thing about the photo diode or transistor is that there is a large amount of ambient light and for most purpose for it to be useful it would be necessary to tell apart the ambient light as 'noise' and say proximity or a signal. the hard part is always the calibration. unfortunately, a lot of times, after calibration, what would normally be done is to make tables out of them so as to use cheaper mcus without an fpu and perform (linear) interpolation to tell the values, in particular as most sensors do not require microseconds response.
then in the case of a thermistor the F4 fpu can probably directly compute the Steinhart–Hart equation directly in floating point without needing to use tables.
https://en.wikipedia.org/wiki/Steinhart ... t_equation
I've been thinking about using this feature in 'sensor' use cases, a coil of copper wire is just a coil until you calibrated it, then it can be used to detect magnetic fields, changing currents, etc. so do many other 'sensors' like a simple photo diode or photo transistor. the main thing about the photo diode or transistor is that there is a large amount of ambient light and for most purpose for it to be useful it would be necessary to tell apart the ambient light as 'noise' and say proximity or a signal. the hard part is always the calibration. unfortunately, a lot of times, after calibration, what would normally be done is to make tables out of them so as to use cheaper mcus without an fpu and perform (linear) interpolation to tell the values, in particular as most sensors do not require microseconds response.
then in the case of a thermistor the F4 fpu can probably directly compute the Steinhart–Hart equation directly in floating point without needing to use tables.
https://en.wikipedia.org/wiki/Steinhart ... t_equation
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: How to use STM32 boards with Arduino IDE and how fast ESP32 vs STM32 are they? (incl. surprise)
non-Wikipedia Discussion:ag123 wrote: Mon Oct 05, 2020 2:42 pm ...
the hard part is always the calibration. unfortunately, a lot of times, after calibration, what would normally be done is to make tables out of them so as to use cheaper mcus without an fpu and perform (linear) interpolation to tell the values, in particular as most sensors do not require microseconds response.
then in the case of a thermistor the F4 fpu can probably directly compute the Steinhart–Hart equation directly in floating point without needing to use tables.
https://en.wikipedia.org/wiki/Steinhart ... t_equation
https://arduinodiy.wordpress.com/2015/1 ... t-formula/
Peter is no longer with us, but he had great insight and enjoyed sharing his work:
https://www.phanderson.com/picaxe/lin_thermistor.html
https://www.phanderson.com/arduino/ntc_therm.html