Everyone starts with something at some point. Since you’re here you’d probably like to start your adventure with STM32 microcontrollers. I also once wanted to. Nowadays, we look for our first help on the Internet. That’s why this blog post was created.
If you are interested in attending the STM32 for Beginners course – you can find all the information at https://kursstm32.pl/
Me and microcontrollers
I started my adventure back in high school. A bit out of compulsion, but it’s always a start.
We had a class on 8051 microcontrollers, and we wrote in …assembler. Seemingly ok, but still as a young individual who does not know exactly what he wants to do in life I did not apply myself to it. In the end I passed the whole subject with a 5 anyway.
Unfortunately, I hated the language. Maybe not the language, but the boring way in which the knowledge was taught to us. The whole semester we first transcribed individual commands (mnemonics) into notebooks, and then the next fired off ready-made from the book….
Since then, I have had an aversion to off-the-shelf products, because they didn’t teach me anything from this assembler or microcontrollers!
At the end of the “wonderful” adventure with the 8051, a colleague showed me his discovery – AVR microcontrollers. “You can do EVERYTHING on this,” he said. So what? I believed hehe.
We started to knit these AVRs in …Bascom. Because supposedly simple and everyone will write something in it. I will say that I even wrote something in that Bascom, but it was still wandering in the fog. I also quickly realized that this language limits me terribly.
Therefore, you need to figure out right away what language the industry mostly uses. For microcontrollers, it will be the C language.
I learned that C and wrote an AVR in it. I was already doing cool projects, etching boards. Eventually during college I got an internship, and eventually got my first job.
A few years later, wanting to change jobs, I crashed into another wall. Almost no one programs AVRs anymore. Technology has moved on, it has become cheaper and now ARMs are in vogue…. I was left behind!
You can’t settle on one solution for years!
I opted for STM32 because there was a lot of talk about them. Of course, I wanted to start my learning on the Internet. Preferably in Polish, but it was not an obligation. I was surprised how few good materials are in our language…. I looked through most of it and started looking elsewhere.
I was a little afraid of re-rooting microcontrollers on my own, by registers. ARMs seemed heavily complex to me, and I also didn’t feel like spending more years learning on my own.
It just so happened that ST began to promote its new developments from under the Cube and HAL more strongly. More and more materials began to appear. However, this alone, combined with my previous knowledge of AVR, was enough to discover new microcontrollers on my own.
I really liked the fact that I don’t have to riff in the registers, and still have some control over the equipment. I can do projects quickly and with satisfactory results. This is what I value most.
I saw that the “one and only truth” being touted everywhere on the forums about embedded being just registries is simply a lie. It is necessary to choose the right tools for the job! Who would drive nails, forge swords and crush walls with one hammer?
What do you need to program an STM32?
- Languages
You need to know two languages. The first and primary one is English! You can’t avoid English when wanting to interact with technology. Even the documentation itself is only in English.
Programming language – C. Do not bother with other creations. You can afford it once you know how to write for microcontrollers in C. - Hardware
Embedded programming is hardware programming.
Let go of the BluePill board from China. Not only do you need an external programmer for it, but it can also cause all sorts of problems. That’s because the Chinese counterfeit the chips on this board and they don’t always all work as expected. It’s a waste of nerves and time while learning. You need to focus on learning, not solving problems out of the blue!
I recommend using official boards from ST, such as the Nucleo series. You can also look at Discovery, but Nucleo for a beginner is definitely better. You have an integrated programmer on it and it always works properly! - Framework
I called it a framework, but what I mean is what concept of libraries or other facilitators you want to interact with. Your choices include.
“Pure C. This is an approach praised to the skies by so-called “pros”. It is supposedly not allowed otherwise. Yes it is good and gives incredibly optimized results. There are also projects where it is impossible otherwise. But this requires a great deal of knowledge, as well as experience. Learning in this mode is also much more difficult.Arduino. STM32Duino has been developed for STM32. The project is growing nicely and has already covered most of the popular Nucleo boards. Arduino is brilliant in its simplicity. It makes it terribly easy for us to get started in microcontrollers, but it has a few problems. When it comes to STM32 it limits them. Many fiches are simply unavailable from Ardu. We also don’t have control over the hardware we use if we just tack libraries onto the project. Strange conflicts can arise.mbed. It’s such an Arduino from ARM 🙂 I used to interact with it and this is my opinion. It is worth checking out, especially mbedOS which is widely used in the industry.ST ecosystem – Cube, HAL, LL. In my opinion, it is a super solution to start. It gives us control over hardware similar to that of programming on registers. On the other hand, it gives us a simplification of the use of hardware and unification of APIs across the range of STM32 microcontrollers similar to Arduino. Many unfavorable legends have grown up around these libraries, mostly from their early days. You can encounter them all the time. For example, under my posts in Social Media all the time someone writes something like “HAL has a lot of bugs, old SPL better!”. Such lies are most often told by people who have never used HAL and know it only from such legends. HAL is my suggestion for beginners! - Software
If I have convinced you of HAL, around it ST has prepared a huge amount of useful software. We get everything working Out of the Box! Let’s stop fighting with non-working software and start programming microcontrollers. STM32CubeMX – A graphical program for convenient project configuration. Simply and pleasantly in a clickable GUI you will configure your microcontroller and generate yourself an initial project.STM32CubeIDE – IDE based on Eclipse (TrueStudio) with built-in CubeMX. One IDE to rule them all!STM32CubeProgrammer –Programmer combo. Programming, memory reading, locking bits and many other useful thingsSTM32CubeMonitor – Monitor variable values in real time. Along with drawing graphs. - Documentation Arduino programming shows us that you can have fun without documentation. Unfortunately, this is a mistake! It is in these sad papers that we will find answers to the most common questions about the capabilities of the microcontroller.Of course, the documentation is in English therefore – point number 1 of this list.For STM32 you need three documents:Datasheet – Basic description of the MCU, clocks, pinout
Reference Manual – Detailed description of registers and functions of the microcontroller
Errata – Document with known errors in MCUM You can still refer to the User Manual for HAL libraries.
Where to get knowledge from?
Subscribe to the waiting list for the STM32 course for beginners so you don’t miss the launch
http://kursstm32.pl
We can acquire knowledge from various sources. Free as well as paid ones. Here are some of them along with my commentary.
- Books
I think it’s quite natural that we type books first. School taught us that. We have several items in Polish, mostly from under the BTC publishing house.I even reviewed one of them some time ago.
They have the advantage of being relatively cheap. Unfortunately, the paper cannot be updated, so they can become outdated fairly quickly. This just happened to the book I reviewed. At the time of its release, ST changed the design of its programs and those in the book do not coincide with what we have now….
They also have the disadvantage of working a bit on ready-made products, or at least I can see that the people using them treat it a bit like that.
I have also read in part “STM32. Applications and exercises in C language with HAL library” by Mr. Mark Galewski. If someone wants a book then yes it is quite ok. There are a bunch of interesting examples of using peripherals in STM32.
And foreign items I have heard a lot of good reviews of “Mastering STM32” by Carmine Noviello. Unfortunately, I haven’t read it yet, so I won’t comment more widely.
- Blogs Blogs are an interesting and free alternative. They have the disadvantage that the topics on blogs do not add up to a single course or learning process. However, there is an abundance of knowledge on single topics.Of course, I recommend my blog, where you are just https://msalamon.pl/. At the time of publishing this article there are as many as 58 posts here. All of them are mainly directed to beginners. I wish I had such a collection when I was learning.From other blogs I follow I can recommend Wojtek from https://elektronika327.blogspot.com/. I have seen that he quite often writes about STM32. However, here, for me, there is often a lack of detailed descriptions and there is mostly just code. Such a bit of ready-made.There is also something in English. I recommend Tilen Majerle’s blog https://stm32f4-discovery.net/. He acct doesn’t write in HAL from ST, because he wrote mostly before it came out. He has a few articles dedicated to current solutions. Bonus: Tilen currently works at ST as Microcontroller Technical Marketing & Field Application Engineer.
- YouTube It’s worth using the world’s second most popular search engine to learn STM32. You can find a lot of good tutorials on single peripherals there. Most are in English, but there is one Polish channel that runs(s) a series teaching STM32 programming.
This Polish channel is Piotr Dub’s channel Piotr 🙂 I watched most of the episodes on STM32. I can in good conscience recommend the series. However, it is only a seed of the STM32 world and only touched on a few basic topics.
Of the English-language ones, I would recommend the official STMicroelectronics channel. There are hundreds or even thousands of videos there. ST runs what they call MOOCs, or Massive Open Online Courses. There are really a lot of good series and training recordings. You can safely use them. I use them myself!
I’ll recommend one more foreign jutuber – MYacoobEmbedded. He has a good series on ST programming in HAL. Single and not too long videos are easy to gulp and understand.
- Online Courses
Then there are online courses of the real kind, which lead from start to finish and have a well thought out learning process. That way we don’t have to search the Internet for what to learn, and we get a complete program to teach us programming.I myself have been using a lot of such courses lately, and I think it’ s a great solution!
From the Polish, of course, I will recommend myself! I have released the STM32 Course for Beginners consisting of up to 12 weeks of work. It’s worth signing up for the waiting list.
Enrollment at http://kursstm32.pl
As for foreign courses, we have Udemy. I haven’t used it, but I’ve heard a lot of good things about this course. It is not on HAL, but on registries, so it is something for strongly determined people 😉
What to watch out for in the courses?
Courses vary, and we often reach for the free ones. We also often use tutorials more than courses. I have seen some popular series on Youtube though for Arduino and they are not outstanding.
What is good about them is going step by step in front of the peripherals in the microcontroller. It’s cool to get to know our circuit piece by piece.
However, so what if we know the pieces, how can we not put them together. Why can’t we?
Developers overuse delay functions, or delays, in their tutorials.
A beginner will learn to delay the microcontroller in just this way, and with later writing such a delinquent lies. He can not later add more functions to his code because, after all, somewhere along the way he is waiting for some measurement. Delay halts the microcontroller completely.
Delay guides appear only as a curiosity, something very advanced and revealing. This is to be at the very beginning, not as an add-on!
That’s why in my course we already deal with delay in the first module. How?
Using software timers and state machines. There is something good for everyone.
Summary
A rather thick book could be written on the subject of learning programming. Everyone has their own rationale and their own views. I presented my thoughts based on my experience.
When I introduce someone to the world of STM32 it is in this way. Whether it’s in individual classes or just in my course.
Remember, this is just the beginning of the road and there are even more opportunities!
If you feel like it, join us in my STM32 course for beginners!
Sign up for the waiting list -> http://kursstm32.pl
If you have noticed an error, disagree with something, would like to add something relevant or just think you would like to discuss the topic, write a comment. Remember that the discussion is to be cultural and in accordance with the rules of the Polish language.

0 Comments