{"id":4209,"date":"2021-02-17T16:55:15","date_gmt":"2021-02-17T15:55:15","guid":{"rendered":"https:\/\/msalamon.pl\/?p=4209"},"modified":"2025-12-27T16:05:23","modified_gmt":"2025-12-27T15:05:23","slug":"these-6-beginner-programmer-mistakes-are-holding-you-back-from-growing","status":"publish","type":"post","link":"https:\/\/msalamon.pl\/en\/these-6-beginner-programmer-mistakes-are-holding-you-back-from-growing\/","title":{"rendered":"These 6 beginner programmer mistakes are holding you back from growing!"},"content":{"rendered":"\n<p>For some time now I\u2019ve been observing what\u2019s happening among beginner embedded programmers. Actually, not only among them, but also in what embedded programming learning materials are passing on to future juniors. I have some serious reservations.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h1 class=\"wp-block-heading\">Problems beginners face<\/h1>\n\n\n\n<p>I have a few observations. Based on my experience, I\u2019ve identified 6 problems that beginners run into. Some of them are clearly the fault of how knowledge is conveyed in widely available courses and tutorials.<\/p>\n\n\n\n<p>Here\u2019s a list of six problems that I consider the most serious on the path of a beginner embedded programmer. Let me describe them to you and give a solution for each one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. I\u2019m following the tutorial and it doesn\u2019t work!<\/h2>\n\n\n\n<p>If we run into trouble \u2013 we go to some forum or discussion group. Most often such a request for help looks like this: \u201cHelp, it doesn\u2019t work. I\u2019m doing everything like here *LINK* and it doesn\u2019t run\u201d.<\/p>\n\n\n\n<p>Know that? For sure \ud83d\ude42<\/p>\n\n\n\n<p>I\u2019m skipping the quality of the instructions themselves, because often that\u2019s also the problem. For example, someone forgot to enable a required interrupt, or a cable was plugged in wrong.<\/p>\n\n\n\n<p>It\u2019s worse when the tutorial is outdated. It may happen that the libraries used in the course are obsolete. The examples won\u2019t work with the latest software stack.<\/p>\n\n\n\n<p>Such a tutorial is outdated and shouldn\u2019t exist. I also realize that once a tutorial is written, it\u2019s hard to constantly check and update it. Especially the free ones \u2013 because there\u2019s no motivation to make fixes.<\/p>\n\n\n\n<p><strong>Solution:<\/strong> Let\u2019s use reliable sources. Ones where the author continuously takes care that the course is up to date. For example <a href=\"https:\/\/kursstm32.pl\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=6bledow&amp;utm_content=Text\" target=\"_blank\" rel=\"noopener\">this course<\/a> (the course content is conducted in Polish).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Programming\/debugging doesn\u2019t work for me!<\/h2>\n\n\n\n<p>I see this mistake extremely often, because I run an electronics store. Most often it appears with Chinese boards that don\u2019t have a built-in programmer.<\/p>\n\n\n\n<p>Similarly, there are no ready-made examples that would take this programmer into account in the code. Tutorials also don\u2019t mention that the debugging pins need to be set appropriately.<\/p>\n\n\n\n<p>Another issue is counterfeits, which happen in Chinese boards. For example in the BluePill, i.e., a board with the STM32F103 which we love because it\u2019s cheap.<\/p>\n\n\n\n<p>In a Chinese programmer there is the same F103, which can also be counterfeit and not work fully correctly.<\/p>\n\n\n\n<p><strong>Solution:<\/strong> Use original boards from ST. For example: <strong><a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-nucleo\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=6bledow&amp;utm_content=Text\">Nucleo<\/a><\/strong>, <strong><a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-discovery\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=6bledow&amp;utm_content=Text\">Discovery<\/a><\/strong>. There, the ST-Link is a sure thing. It\u2019s also properly wired. Additionally, creating a project in CubeMX based on Nucleo, and not on the MCU, will always correctly configure the debug pins.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. I\u2019d like to do many things at once<\/h3>\n\n\n\n<p>A genre classic. We can blink one LED. The problem appears when we need to blink two, and at different rates. How do you do two delays at once?<\/p>\n\n\n\n<p>Second situation. We have to implement debounce for buttons. 20-30 milliseconds is enough. We throw in a delay, handle 5 buttons and what? It doesn\u2019t work very smoothly\u2026<\/p>\n\n\n\n<p>Additionally, when pressing one button, sometimes we miss the reaction to the second. How to live?<\/p>\n\n\n\n<p><strong>Solution:<\/strong> Learn right away to write correct code without using delays! This can\u2019t be \u201csomething extra\u201d. It\u2019s the foundation of writing programs for microcontrollers. I recently showed such a simple method with a software timer on <strong><a href=\"https:\/\/youtu.be\/6MwJyFZVMDk\" target=\"_blank\" rel=\"noopener\">LIVE<\/a><\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u2026which leads to \u201cjust use an RTOS\u201d<\/h3>\n\n\n\n<p>Someone politely suggested that you should get interested in an RTOS. \u201cIt will do everything for you,\u201d they say. Yeah, but\u2026<\/p>\n\n\n\n<p>An RTOS, i.e., a real-time operating system, is a great tool, but a very complex one. A beginner programmer will not be able to simply take a system and add it to a project. There is no magic button in the IDE \u201cadd RTOS\u201d.<\/p>\n\n\n\n<p>A young learner, not knowing how such systems work, will become even more discouraged from programming microcontrollers.<\/p>\n\n\n\n<p>Such advice for someone who doesn\u2019t know how to blink two LEDs at once is very harmful. Let\u2019s not do that.<\/p>\n\n\n\n<p>There\u2019s one more problem with RTOSes. Tutorials about them are based on printing to the console and blinking LEDs. That works great in these simple examples where individual RTOS components are discussed.<\/p>\n\n\n\n<p>It\u2019s worse when you add I2C, ADC, DMA, and other components to the project. Suddenly the project becomes complicated and brings a lot of weird problems. It turns out that using that RTOS isn\u2019t as simple as it seemed.<\/p>\n\n\n\n<p><strong>Solution:<\/strong> If you actually want to use an RTOS, learn it first. And learn it well. Ideally, someone should show you how to build a real project. Learning with LEDs and printing is one thing, but actually using the system is a completely different story. My students follow this whole path in the course <a href=\"https:\/\/kursstm32.pl\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=6bledow&amp;utm_content=Text\" target=\"_blank\" rel=\"noopener\">STM32 for Beginners<\/a> (the course content is conducted in Polish).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Working with DMA<\/h3>\n\n\n\n<p>When moving from AVR to ARM, we get a brilliant tool (or maybe rather a peripheral?) called DMA \u2013 Direct Memory Access.<\/p>\n\n\n\n<p>It\u2019s a microcontroller block that allows working with memory without CPU involvement.<\/p>\n\n\n\n<p>The problem is that it\u2019s hard for us to grasp that something is happening \u201cin the background\u201d outside the processor. We\u2019re used to sequential code execution, so we often don\u2019t know how to work with DMA.<\/p>\n\n\n\n<p>The only thing we send to DMA is an operation \u201crequest\u201d. We don\u2019t handle the memory operation itself, so we can do something else in the meantime, and DMA will notify us when it\u2019s finished.<\/p>\n\n\n\n<p><strong>The first mistake I see is waiting in a loop for DMA to finish the transfer.<\/strong> For example, we request sending data to an OLED and we wait in place until that data is sent via DMA. We don\u2019t do that. After requesting the transfer, we go do something else.<\/p>\n\n\n\n<p><strong>The second mistake is replacing a function, e.g. one that transmits over I2C, with a DMA version.<\/strong> For example, we have an OLED with paging and we have to send 8 pages of a buffer.<\/p>\n\n\n\n<p>Normally, without DMA, we send one after another. The CPU actively participates in the sending, so a simple for loop does the job here.<\/p>\n\n\n\n<p><strong>Blindly replacing transmission with a DMA transmission in such a place breaks the program!<\/strong> Because we have 8 transfer requests to DMA in a row. With minimal time gaps. DMA hasn\u2019t managed to send the first page to the OLED yet, and we already tried to shove all 8 in.<\/p>\n\n\n\n<p>The CPU will bounce off DMA because it\u2019s busy, and what\u2019s the effect? The OLED doesn\u2019t work!<\/p>\n\n\n\n<p><strong>Solution:<\/strong> You need to learn how DMA works and how to interact with it. Let\u2019s switch to the mindset that we request the transfer and wait for a sign-signal from DMA that it can accept the next chunk of data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. I\u2019m looking for a library for\u2026<\/h3>\n\n\n\n<p>Finally, searching for libraries. We\u2019re lazy and we like ready-made solutions. Besides, it\u2019s good to use something that has already been written before.<\/p>\n\n\n\n<p>Arduino has accustomed us to the fact that everything is ready there. Often such libraries are written by amateurs and may contain hidden delays! The Arduino IDE itself also makes it harder to peek inside libraries, and we don\u2019t know what they actually do. And they can do all sorts of weird things!<\/p>\n\n\n\n<p>Another problem is that there simply aren\u2019t as many libraries for bare STM32 as for Arduino.<\/p>\n\n\n\n<p>And finally\u2026 what if you have a chip for which there is no library even for Arduino?<\/p>\n\n\n\n<p><strong>Solution:<\/strong> Learn to write libraries based on documentation. This will give you more freedom, and also understanding of ready-made libraries.<\/p>\n\n\n\n<p>Secondly \u2013 learn how to correctly port libraries from other microcontrollers \u2013 e.g. Arduino. You don\u2019t always have to write everything from scratch.<\/p>\n\n\n\n<p>I teach these two approaches to libraries in my course <a href=\"https:\/\/kursstm32.pl\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=6bledow&amp;utm_content=Text\" target=\"_blank\" rel=\"noopener\">STM32 for Beginners<\/a> (the course content is conducted in Polish).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where to learn this?<\/h2>\n\n\n\n<p>Most generally available courses and tutorials introduce these mistakes and problems. With each successive one, they get repeated. So where can you learn how to deal with them?<\/p>\n\n\n\n<p><strong>I decided that I would break with the repeated wrong patterns and create a course that solves all of the above problems.<\/strong> <strong>The STM32 for Beginners course will allow you to learn programming the RIGHT way.<\/strong><\/p>\n\n\n\n<p>If you learn to program correctly, your projects will be much better.<\/p>\n\n\n\n<p><strong>You will also land your first job, if that\u2019s what you\u2019re looking for.<\/strong> Maybe you\u2019re looking for a better job than you have right now?<\/p>\n\n\n\n<p>Until Friday 19.02 at 20:00 you have a chance to enroll in the course and change your programming once and for all.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><span style=\"font-size: 18pt;\"><strong>All details about the course and participation in it can be found on the course page: <a href=\"https:\/\/kursstm32.pl\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=6bledow&amp;utm_content=Text\" target=\"_blank\" rel=\"noopener\">https:\/\/kursstm32.pl<\/a><\/strong> (the course content is conducted in Polish).<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kursstm32.pl\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=6bledow\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"194\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2021\/02\/Kurs-STM32-roz.jpg\" alt=\"\" class=\"wp-image-1834\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/02\/Kurs-STM32-roz.jpg 820w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/02\/Kurs-STM32-roz-300x71.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/02\/Kurs-STM32-roz-768x182.jpg 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/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;4209&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;These 6 beginner programmer mistakes are holding you back from growing!&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>For some time now I\u2019ve been observing what\u2019s happening among beginner embedded programmers. Actually, not only among them, but also in what embedded programming learning materials are passing on to future juniors. I have some serious reservations.<\/p>\n","protected":false},"author":1,"featured_media":3577,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[160],"tags":[178,176,174],"class_list":["post-4209","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stm32","tag-kursstm32","tag-programming","tag-stm32"],"_links":{"self":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4209","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=4209"}],"version-history":[{"count":3,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4209\/revisions"}],"predecessor-version":[{"id":4212,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4209\/revisions\/4212"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media\/3577"}],"wp:attachment":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media?parent=4209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/categories?post=4209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/tags?post=4209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}