{"id":4329,"date":"2019-03-20T20:00:31","date_gmt":"2019-03-20T19:00:31","guid":{"rendered":"https:\/\/msalamon.pl\/?p=4329"},"modified":"2025-12-27T19:55:56","modified_gmt":"2025-12-27T18:55:56","slug":"examining-the-book-stm32-microcontrollers-for-beginners","status":"publish","type":"post","link":"https:\/\/msalamon.pl\/en\/examining-the-book-stm32-microcontrollers-for-beginners\/","title":{"rendered":"Examining the book &#8220;STM32 Microcontrollers for Beginners&#8221;"},"content":{"rendered":"\n<p>Some time ago, an interesting book \u201cSTM32 Microcontrollers for Beginners\u201d from BTC Publishing appeared on the market. To my knowledge, this is the first widely released book that fully relies on the HAL libraries and is aimed at those who want to start their adventure with our favorite microcontrollers. For that reason, I was very curious to see what the author had to say.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I didn\u2019t have to think long about buying the book for review because shortly after the release, the company Kamami offered to send me a set with the KA-NUCLEO-F411CEv2 development board, on which the examples in the book are based. Very kind of them, I appreciate it \ud83d\ude42<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">KA-NUCLEO-F411CEv2 evaluation board<\/h1>\n\n\n\n<p>The PCB is modeled after the popular Arduino. The same connectors as in the Arduino Uno have been brought out for the user. Similarly, there\u2019s an ST-Link programmer already on the development board. Thanks to it, you don\u2019t have to worry about additional components. Working with the kit is therefore convenient and boils down to USB communication.<\/p>\n\n\n\n<p>The PCB is populated with an STM32F411CE microcontroller. It\u2019s an interesting choice, if only because it comes in a UFQFPN48 package, while classic <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/nucleo-f411re\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=dlaczegostm32&amp;utm_content=Text\">Nucleo boards from ST are based on STM32F411RE<\/a> in LQFP64 packages. What are the consequences? Namely, the user has fewer I\/O pins at their disposal. Is that a drawback? In a way, yes, but admit it\u2014how many beginner programmers need all the pins from a Nucleo right away? The limitation of outputs can have its advantage in the form of avoiding confusion in their configuration by a still inexperienced embedded developer. Especially since STM32s offer far more peripherals than an Arduino. Apart from the number of I\/O, the chips don\u2019t differ in anything special according to ST Finder.<\/p>\n\n\n\n<p>So we have 512 kB of Flash memory, 128 kB of RAM, and the entire chip can run at a maximum frequency of 100 MHz. It\u2019s a little beast for a beginner\u2014and that\u2019s great.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The book \u201cSTM32 Microcontrollers for Beginners\u201d<\/h2>\n\n\n\n<p>The author of today\u2019s book is Aleksander Kurczyk. He gets a plus from me right from the start because Olek studies at the university I graduated from myself\u2014Wroc\u0142aw University of Science and Technology. And on the same faculty, no less. He\u2019s currently in his final semester, so I\u2019m keeping my fingers crossed for his master\u2019s defense \ud83d\ude42 Interestingly, he is the author of numerous publications in magazines, including articles in \u201cElektronika Praktyczna.\u201d I\u2019m very pleased that there are still people who are eager to share their interests and skills with a wider audience. Olek is also a budding entrepreneur and, together with friends, runs a company in the IT industry.<\/p>\n\n\n\n<p>Right from the introduction, the author clearly states who this book is for and what you will learn from it. If you are looking for a book that describes the C language from scratch, unfortunately this isn\u2019t it. Same with explaining the ARM architecture and the components contained in SMT32. The author doesn\u2019t needlessly confuse the reader at the very beginning.<\/p>\n\n\n\n<p>Instead, the book guides you step-by-step through the tools and IDE provided by ST Microelectronics for their microcontrollers. Unfortunately for the author, at the time the book was published, ST bumped the STM32CubeMX version while redesigning the graphical appearance of the entire tool. Therefore, the screenshots from STM32CubeMX will not be identical to the latest version of the tool. However, anyone who can use a computer should cope just fine. These aren\u2019t drastic changes, and from a project configuration standpoint, in my opinion it\u2019s mostly cosmetic.<\/p>\n\n\n\n<p>The IDE used in the book is Atollic TrueStudio, acquired by ST. By the way, I myself was so deeply sunk in the old SW4STM32 that I missed the fact that Atollic had been bought by ST. Today it\u2019s the official and recommended environment. I\u2019ve already made the switch \ud83d\ude42<\/p>\n\n\n\n<p>The second chapter is key for later work. In it, Olek presents the process of creating a project from scratch in the STM32CubeMX tool. He describes pin configuration in a simple way\u2014in this case, GPIO. Of course, the perfect project for this is blinking an LED. I can\u2019t imagine another \u201cHello World,\u201d and that\u2019s how it is in the book. After a moment, he expands the example with button handling, then smoothly in the next chapter moves on to handling PWM on the same LED. He spices up timer operations with gamma correction.<\/p>\n\n\n\n<p>What I noticed when reading this book is that after the LED introduction, it immediately moves on to the UART interface. When I was learning microcontrollers, I remember that UART was relatively far back in my books. That was a serious mistake because it\u2019s a very useful interface for both beginners and advanced programmers. During the learning stage, everything we do in the MCU can be printed to a terminal on the PC. Thanks to this, simple debugging or logging code behavior is pleasant. Kudos to the author for presenting a project with UART so early.<\/p>\n\n\n\n<p>Only after a more elaborate example using UART with a GPS receiver does it move on to SPI and I2C. And here\u2019s another surprise: the first SPI example is the addressable WS2812B LEDs, which are not controlled by this interface. The topic is tackled very similarly to one of my articles (link), but ultimately without using DMA.<\/p>\n\n\n\n<p>Next, I would expect a trivial classic in the form of a shift register on SPI. However, here comes another surprise, because a TFT display is employed as an example of a \u201cclassic\u201d use of the SPI interface! What\u2019s more, with a touch panel, although it\u2019s only resistive, while we\u2019re surrounded everywhere by capacitive ones. The discussion of the touch panel is separated from handling the TFT, which adds clarity.<\/p>\n\n\n\n<p>For the I2C bus, the projects are more classic examples: the popular BMP180 and BME280 pressure sensors. I\u2019m trying to recall whether I\u2019ve seen any spectacular I2C device and I can\u2019t come up with one. In general, this interface serves precisely to handle various sensors.<\/p>\n\n\n\n<p>The next element discussed is the analog-to-digital converter built into the STM32F411CE. Interestingly, the ADC measurement is taken on the MCU\u2019s built-in analog temperature sensor, so doing the exercises doesn\u2019t require connecting an external circuit. A plus here is showing two reading methods. The simplest, i.e., polling\u2014\u2018manually\u2019 querying the ADC for the converted value\u2014and the more interesting DMA mode, i.e., automatically reading results without CPU involvement. It\u2019s a pity that there\u2019s only this much about DMA in the book, because it\u2019s a very useful microcontroller component.<\/p>\n\n\n\n<p>Near the end of the book, a project appeared that interested me the most. It\u2019s WiFi realized on the ESP8266 module. These modules can indeed work as standalone microcontrollers, but they also perform great as a WiFi card. Especially the module variant used in the project. A simple project of modifying the color of the development kit\u2019s built-in LED plants a seed of curiosity in me. I will definitely explore the ESP8266 further as a WiFi module for STMs.<\/p>\n\n\n\n<p>In the next chapter, we see UART in action again. This time it\u2019s the popular HC-06 Bluetooth module. Unfortunately, I greatly lament that the code listings in this chapter are incorrect. Every project file in the book is the same\u2014the code for main.c has been duplicated. I hope this will be corrected in the next edition. By the way, I think printing many pages of code in a book is not the best idea. I much prefer inserting very short links to external materials, as Micha\u0142 Szafra\u0144ski does in his books. I also didn\u2019t notice any mention in today\u2019s discussed book of an online place with all the projects. A pity, because I myself eagerly read such projects in a \u201cfull\u201d form. Maybe BTC Publishing will consider such an approach to codes\/projects?<\/p>\n\n\n\n<p>At the very end of the book, another surprise. The last section touches on real-time operating systems. In this case, it\u2019s freeRTOS provided with STM32CubeMX. This is somewhat what all newbies on Arduino ask: \u201chow to do two things at once?\u201d. With the help of an RTOS it\u2019s easier, but it can be dangerous, which the author fortunately mentions. It\u2019s about race conditions, and Olek immediately presents two mechanisms to control this problem\u2014semaphores and queues. Generally, the book is really just a teaser when it comes to RTOS, but sufficient enough to get interested in the topic and consult other sources and books.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>The book isn\u2019t thick, so it reads quickly. It has about 230 pages, where quite a large part is screenshots or code listings. It doesn\u2019t drill deep into each discussed topic, so there\u2019s no information overload. Someone who wants to move to SMT32 won\u2019t be overwhelmed by the amount of information. In fact, this book gently introduces the ST ecosystem. It allows you to smoothly start working in STM32CubeMX and Atollic TrueStudio without obstacles.<\/p>\n\n\n\n<p>This title will be good for you if you\u2019re already somewhat familiar with the C language and microcontrollers, e.g., transitioning from Arduino. I\u2019ll say right away that if you\u2019re the type who likes to squeeze the maximum knowledge out of every topic, you may feel unsatisfied. In many places, the author takes shortcuts, discussing only what\u2019s necessary to implement the described project.<\/p>\n\n\n\n<p>If you already fluently create complex projects and write your own libraries, you won\u2019t be satisfied with the reading, although not every advanced user has used a WiFi module, which, for example, interested me in this book. On the other hand, I don\u2019t know if I would call myself that advanced \ud83d\ude42 However, people at a high level of expertise should probably skip this book. After all, the title directly indicates who it\u2019s for.<\/p>\n\n\n\n<p>Would I recommend this book? Absolutely. It\u2019s written in a simple language, which made it one of the more pleasant reads on programming for me. However, learning doesn\u2019t end with this book. You have to keep learning\u2014whoever stands still moves backward!<\/p>\n\n\n\n<p>It\u2019s worth keeping in mind that an e-book is also available. That\u2019s for those who like to work with a book on screen with multiple monitors or who simply prefer digital versions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Contest<\/h2>\n\n\n\n<p>Would you like to win the set I described today, i.e., the book \u201cSTM32 Microcontrollers for Beginners\u201d along with the KA-NUCLEO-F411CEv2 board? The rules will be simple and will consist of a few steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You must be a subscriber to the blog\u2019s newsletter (content in Polish).<\/li>\n\n\n\n<li>Like my Facebook fanpage \u2014 <a href=\"https:\/\/www.facebook.com\/msalamonpl-337301850459416\/\" target=\"_blank\" rel=\"noopener\">Fanpage msalamon.pl<\/a><\/li>\n\n\n\n<li>Write a comment with the hashtag #konkurs under the Facebook post promoting the review, in which you write about how you are starting or want to start with microcontrollers \u2014 <a href=\"https:\/\/www.facebook.com\/permalink.php?story_fbid=361199978069603&amp;id=337301850459416&amp;__tn__=-R\" target=\"_blank\" rel=\"noopener\">link<\/a><\/li>\n\n\n\n<li>Publicly share on your profile the post promoting the review \u2014 the same post as in item 3<\/li>\n\n\n\n<li>Let me know in a comment under this article how you liked the review and whether you\u2019d like to see more of this type of material here.<\/li>\n<\/ol>\n\n\n\n<p>Huh, it turned out to be a few points, but the prize is solid too, so I think it\u2019s worth it \ud83d\ude42 From among the people who meet the conditions, I will choose a winner with the most interesting answers and send them the book + board. What\u2019s more! <strong>The company Kamami will additionally gift 3 people with the same set! In total, there will be <span style=\"font-size: 18pt;\">four<\/span> winners.<\/strong><\/p>\n\n\n\n<p>The contest lasts until just before the publication of the next post, i.e., until <strong>April 3, 2019 at 7:00 p.m.<\/strong> There\u2019s plenty of time; you can think your answer through \ud83d\ude42<\/p>\n\n\n\n<p>P.S. I would like to give the books to people who are actually taking their first steps with STM32 microcontrollers or are at the early stages of learning. I would ask those hungry for free goodies to refrain from participating in the contest. It\u2019s enough, for example, not to include the hashtag in your comment on Facebook, or to write on the blog that you don\u2019t want to participate in the contest.<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;4329&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;0&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Examining the book \\u0026quot;STM32 Microcontrollers for Beginners\\u0026quot;&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago, an interesting book \u201cSTM32 Microcontrollers for Beginners\u201d from BTC Publishing appeared on the market. To my knowledge, this is the first widely released book that fully relies on the HAL libraries and is aimed at those who want to start their adventure with our favorite microcontrollers. For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[183,160],"tags":[175,176,174,177],"class_list":["post-4329","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-books","category-stm32","tag-electronics","tag-programming","tag-stm32","tag-stm32cubemx"],"_links":{"self":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/comments?post=4329"}],"version-history":[{"count":3,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4329\/revisions"}],"predecessor-version":[{"id":4437,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4329\/revisions\/4437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media\/3148"}],"wp:attachment":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media?parent=4329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/categories?post=4329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/tags?post=4329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}