Hacker News new | ask | show | jobs
by nickff 2217 days ago
STM32 is available with more, and better peripherals and interfaces than the ESP32. Embedded microcontrollers perform a wide variety of tasks, aside from simple digital communication.

[0] I am an embedded engineer who works with STM32 and bluetooth modules

3 comments

So this is totally off-topic and a bit you are going to think I am very rude for intruding:

I was just looking around whether it is possible to create custom apps (on phones) to sync with smart watches (generic ones from places like aliexpress). I have no experience with bluetooth, but is there anything that would prevent you from making something like that? Even if it is just for myself, I don't need to release or anything.

Do you happen to know if it is possible and where I can look?

There are no hardware obstacles to doing that, and BLE (BT4 and 5) support custom protocols. That said, I think you will find that working with the proprietary operating systems and architectures on watches and phones is much more difficult than you anticipate.
I figured it is most likely too difficult. For the amount of work it would take I could just buy an Apple watch and be done with the privacy concerns I have with cheaper trackers, but once the seed of an idea is planted it starts having a life of its own.

I think this is an idea I shouldn't water though ;).

try gadgetbridge, it's an OSS project that already does this for cheap fitness trackers and some watches.

https://gadgetbridge.org/

Wow this is amazing! It is exactly what I was looking for except for it being on Android only, but at least I now have a whole code base to learn from. Thanks!
The esp32 has quite a rich set of peripherals on its own.
I would describe the ESP32 as having a basic peripheral set. The ADCs and DACs are not great, and there are basically no other analog peripherals. The timers are meager, and low-power functionality is lacking.

The documentation is horrible, which is very important when you compare it to NXP and STM which both put out fantastic 2k-3k page reference manuals.

Yes it's a shame. The hardware is quite capable for the price but the documentation is lacking, so one has to resort to reverse-engineering - which is totally ridiculous. Traditional MCU vendors have set quite a high standard to the quality and availability of documentation.

I know good documentation takes effort, but the lack thereof is hampering the product.

One can only hope that with Espressif trying to become more mainstream, they will improve in that department.

A datasheet is a contract, not just documentation. If they put something on the datasheet, they need to write the document, then test the parameter, and guarantee that performance.

If I receive 10k of a part that does not satisfy specified performance parameters, I will return the reels, and never design that manufacturer's parts into any future product.

Oh, surely they're not contracts. They're full of disclaimers like: "MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND [..], RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE."

And then they publish 50 pages errata including: "Ethernet functionality in 64-pin packages is not available."

...

Well the Errata Sheet should be considered part of the data sheet ;)

Working with same54 has taught me to always also read the Errata Sheet when checking out a feature, I can only guess that there was a bit of a shake-up with the acquisition by Microchip that so many errors slipped in.

But those are at least consistent across chips.

Not that STM32 is any different. Recently I designed around STM32F105 specifically due to it's ROM USB bootloader. Too bad I didn't read the errata which says no USB bootloader for 64 pin package.
Well, I can tell you that if 5% of the parts on a reel are out of spec, that reel is being returned for a full refund. Everyone treats the datasheet as a contract, whatever the small print may say.

This is also why parts can often perform well above their specified performance levels, and often have undocumented functionality; the manufacturers are happy to design in this performance, but they refuse to test and guarantee it.

what's your reccomendation ?
Depends on your application and requirements.
Just a basic board comparable to the ESP32 modules you can but for DIY stuff
I generally recommend going for the highest-spec board that suits your requirements. The STM32L4+, STM32L5, and STM32H7 are all amazing microcontrollers.
I'm playing with STM32 Cube IDE right now. I got surprised that it works well on Linux (ok, I did only basic stuff, but did not have any trouble setting it up).

However I was wondering what would be totally open source toolchain and development setup? That might be too advanced for me now (and I'm happy with graphical peripheral selection in ST tools), but would like to try it in the future

gcc and OpenOCD work well.

There are plenty of open source projects for STM32

There is https://www.openstm32.org

Also there are plenty of Open Source RTOS projects that come with a HAL, so you can write code that is vendor independent.

Zephyr is probably the largest full-featured RTOS, it's backed by the Linux Foundation and several hardware vendors (NXP, Nordic, Intel, Ti and SiFive), but the community provides support for other vendor's chips too.

RIOT-OS is more popular in the academic sector, targeting sensor networks.

NuttX tries to bring a POSIX environment to your MCU and of course STM32 is supported there too.

there is of course ARM Mbed, but that feels more like a framework than an integrated OS.

Heck you can even run Linux on the larger STM32s (M4, M7) if you attach some external RAM - kernel support was provided by ST themselves.

Are any of those available multi-core? It's one thing that's pretty nice on the ESP32, especially for the cost and lack of complexity for simple cases. I couldn't find a similar STM32 part that was relatively cheap, low pin count (eg 48 pin with ethernet Mac support), and had dual core.
that's the right answer!