STM32 Microcontrollers based dev boards

hello guys,

I've been playing with Arduino for somewhat a year now. I'm currently doing a project that I think a microcontroller with higher CPU clock speed than the 16 Mhz of the Uno would work better. But the only Arduino board with higher clock speed is discontinued, the Arduino Due.

Recently I ran into the stm32 microcontroller series, which seems pretty attractive (high clock speed, more FLASH and SRAM, high res. ADCs & DACs, etc.). But I have no idea on how to use/program these microcontrollers. All i know is that there is a dev board called Nucleo which looked pretty interesting. Are stm32 microcontrollers Arduino compatible?

Anyone know anything about stm32 microcontrollers or the Nucleo boards? Any help/comments would be greatly appreciated! :)

Yes, some stm32 boards are Arduino compatible. I have a Maple Mini clone for example. There is a forum separate to this forum where you can ask for advice.

www.stm32duino.com

There is also the Teensy 3 boards by PJRC which are stm32 based. Again there is a separate website and forum for those boards.

https://www.pjrc.com/teensy/

There are the Particle boards, which are stm32 based with built-in WiFi.

https://store.particle.io/

You could also consider ESP8266 boards. These are not stm32 based, but have similar speed memory etc.

Hey Paul, I tried to make an account on stm32duino.com but I received no confirmation email. Now I'm stuck because that's the only mailbox I have, and I can't use the same mail address to try to register a new user. I think the Maple boards look pretty friendly since they have an IDE that's similar to Arduino's IDE. I'm not too sure about the Teensy boards though. Do you know what should I do if I'm stuck on the registration thing for stm32duino.com? thanks!

Unturned3: Hey Paul, I tried to make an account on stm32duino.com but I received no confirmation email. Now I'm stuck because that's the only mailbox I have, and I can't use the same mail address to try to register a new user. I think the Maple boards look pretty friendly since they have an IDE that's similar to Arduino's IDE. I'm not too sure about the Teensy boards though. Do you know what should I do if I'm stuck on the registration thing for stm32duino.com? thanks!

I've referred your issue to the board op. Roger will figure this out. Expect an email or a PM in this forum.

Ray

Unturned3: I think the Maple boards look pretty friendly since they have an IDE that's similar to Arduino's IDE. I'm not too sure about the Teensy boards though.

You can use the standard Arduino IDE with both the Maple Mini and Teensy. You just need to download extra packages which enable the IDE to upload sketches to these particular boards. You can find instructions for doing this on those websites.

Unturned3: Do you know what should I do if I'm stuck on the registration thing for stm32duino.com?

Just wait. The forum administrators probably check all new users before giving them access, to try to defeat spammers. The stm32duino forum is run by Roger Clark, who used to post on this forum also. He lives in Melbourne, so may be asleep now!

PaulRB:
<…>
You could also consider ESP8266 boards. These are not stm32 based, but have similar speed memory etc.

In my experience, they are both 32-bit and are both RISC; however the STM32F103 is an M3 core and exhibits some optimizations, branch prediction, and pipelining that makes it computationally superior to the ESP8266 computational unit. Also, ESP8266 has the EEPROM flash external to the uC, so an instruction cache is used to mitigate the slow-down.

The STM32 also has DMA which has been implemented in the STM32duino.

Ray

PaulRB:
You just need to download extra packages which enable the IDE to upload sketches to these particular boards. You can find instructions for doing this on those websites.
<…>

Both boards have an installation Json script. Be careful with the ESP as the latest ArduinoIDE is not fully qualified, yet.
esp8266 - installing-with-boards-manager

STM32duino

These two products are both in the $4 and under range. The STM is a serious bang for the buck. The ESP8266, I recommend the NodeMCU board with onboard serial-USB, is a great utility system, but one must remember it was not designed for user performance; that is the arduino sketch runs in a 50mS or less timeslice alternating back to the ESP RF radio native code… blocking code use in the Arduino timeslice will cause the watch dog to bark & barf and the uC will reboot. That said, newbies must really think about jumping onboard this platform.

Ray

My Projects

I am also a fan of esp8266. Maybe clock-for-clock, the stm32 has the edge, but the esp has loads of ram and a user-configurable clock speed of 80 or 160MHz. And at around the same price as most stm32 development boards, has built-in WiFi. Adding WiFi to other dev boards costs around the same as buying an esp dev board.

My favourite esp dev board is the Wemos D1 mini. $4+shipping.
D1-mini-Mini-NodeMcu-4M-bytes-Lu.jpg

To demonstrate it’s speed, in this video it is calculating Conway’s game of life on a 512x512 grid at several tens of generations per second, and updating a 128x64 oled screen at the same time.

Andreas does some (not very scientific) tests in this video to compare the speed of the Maple Mini to an ESP and also the Arduino Due and the Pro Mini.

@PaulRB,

The Maple Mini clone shines with SPI DMA... here is a vid by the dude that implemented the DMA: https://youtu.be/bv_LYtYQCmk

And, my implementation of Harichord using the Adafruit ILI9341 lib (mod): https://youtu.be/EQ8qvEkZam4

The ESP8266 has great integer performance and when Arduino routines (objects) can be kept in IRAM, it shines. But while it is a great little 32-bitboard, tge STM32F1xx blows it away when DMA is implemented.

But any Arduino seasoned user of 8-bit devices will be blown away by either board; although I lean toward the Maple Mini clone by Baite fir non-WiFi projects.

Ray

Please register and post to STM32duino.com

Generally I find that one MCU is not ideal for every project I undertake.

ESP8266 is great if you need WiFi and dont need lots of GPIO or multiple hardware serial, and are not running from batteries, and dont need multiple hardware serial, or dont need very fast SPI, or dont need you code to be read only etc etc.

If you need a lot of RAM or a lot of flash, the STM32 is not the device you you either, as the ESP8266 has loads of both, albeit the flash is external.

Price per performance , your best bet is the GD32 clone of the STM32F103C8. Its significantly faster than the STM32 and the ESP8266, as it uses shadow RAM into which the program is copied at startup ( without noticable delay), and easily runs overclocked at 120Mhz whist still running USB. I suspect it could be overclocked to 150MHz or above, but the USB bus clocks cant be configured for this speed.

I bought some GD32 boards on Taobao for $1.50 USD

If you need low power, the STM32F103 is kinda OK, but not ideal. For that you need something like the STM32L0 or STM32L4

If you want raw speed, you could take a look at the STM32F7 range, but at the moment we dont have an arduino core for this ( but STM may create one)

Thanks for the reply so far guys! I decided to start from the Teensy boards. Any suggestion on which board to start with? Teensy 3.2 looks pretty nice to me. Do I just connect it to my Mac via USB and use the Arduino IDE to program it? P.S. Other than the Arduino IDE and its libraries, what other options are there for you to program an STM32?

Richard

Unturned3: Thanks for the reply so far guys! I decided to start from the Teensy boards. Any suggestion on which board to start with? Teensy 3.2 looks pretty nice to me. Do I just connect it to my Mac via USB and use the Arduino IDE to program it? P.S. Other than the Arduino IDE and its libraries, what other options are there for you to program an STM32?

Richard

I would recommend the 3.2 Teensy. Here is the install procedures ... note, the Teensy software is version-centric.

Ray

There is also the http://www.arduino.org/, they are building the Arduino Star. It is a STM32F4 based card. http://www.arduino.org/forums/star. The problem is that it is not available yet.

I like the STM32F Arms from ST.

I do not know about http://www.stm32duino.com/ but I have to study it a bit now.

STM are in the process of releasing an official Arduino support for some of their Nucleo range of boards.

This will be rolled out over the next few months.

Currently only the Nucelo F103RB and Nucleo L4 have been released, but another 4 boards are in the pipeline.

I will post a request to add the Boards manager package to the list of third party cores.

Note. The Stm32duino community is working on supporting a large number of other STM32 boards, but we do not have a fully functional release for any other boards at the moment

Very good to hear. Allthough now there will be maybe too much support, hard to choose one. I am partly joking of course.

STM32 is a nice HW family. Arduino has very good libraries. Together they will be good for hobbyist and small projects, in my opinion. At least I am interested, if you didn’t notice it already.

Guys what do the "Professionals" use when programming STM32s like Nucleo boards? Do they also use the Arduino Library or they use the libraries provided by ST? All I know is that people use pure C to program AVRs for more advanced controls. Is it the same with STM32s? I would like to move onto the "Pro" libraries for more complex topics once I mastered the Arduino libraries and STM32s. :D

There are atleast two kinds of libraries to program STM32s. If you use ST's tools that is. This is closer to the metal. https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx

This is a bit easier https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx

There is Avrfreak for lower level AVR programmer. And Atmel datasheet has examples about using the HW.

If you are working for a big customer you are being pampered by the manufacturer. You might well know the manufacturers designers personally and they'll help you. You'll live in a fairyland.

Edit: STs forums are buggy

For professional users STM have a tool called the STM32CubeMx, which is a code framework generator ( well anyone can use it, as its free to download)

It produces code including the HAL ( Hardware Abstraction Layer) libraries.

I am not sure which IDE STM recommend, but the code that is generated, includes a project file for Atollic True Studio.

I think you will find a lot of existing commercial ST developers still use the older Standard Peripheral Library, in preference to the HAL. But using the SPL is problematic for open source development, as the license is restrictive and has a non redistribution clause.

Using the HAL or SPL requires a lot more coding than using the Wiring API that Arduino uses, and you will not be able to use any Arduino libraries etc, without a considerable amount of work to port them to the HAL or SPL API

Recent days, I have explored about STM32 and extremely excited with it. There are more Flash, more Ram, more CPU clock, more IO pins etc... and the especial is that it's very inexpensive compared to AVR. I ordered some STM32F103C8T6 boards from taobao about 1.5$ for each board.

I had some years experiences with Arduino and a basic skill in programming. But for now I still confuse what should I do to begin with that chip such us IDE, upload tool, libraries ...

All your suggestions and advices are welcome and very appreciation.

Thanks,

If you want to start with STM32F I would recommend the following tools.

Keil Ide demo version, it is available for several different processor families, so check that. I dont remember how I set it up but I think it was easy. That’s why I recommend it.

CubeMX tool from ST. STM is not at all like AVR, When you play with the tool, you’ll notice why it is needed. It produces projects for the Keil and and several other IDES.

Buy a Discovery board, perhaps a 407 or a 7xx model.

Download and install STM link software. It is a standalone program uploader.

You may need a STM link dongle, too. But it should not be needed.

In one of my previous mails here I gave links to ST STM32F forums, check those. They are not as good as Arduino forums, you are supposed to know what you are doing, but they may help.

Edit: Waveshare in China has some nice kits with accessories. You should check those too. They have SW for their kits, but the support is not at the same level as in here or in ST forums.