{"id":4365,"date":"2018-07-11T20:00:12","date_gmt":"2018-07-11T18:00:12","guid":{"rendered":"https:\/\/msalamon.pl\/?p=4365"},"modified":"2025-12-27T20:38:47","modified_gmt":"2025-12-27T19:38:47","slug":"why-stm32","status":"publish","type":"post","link":"https:\/\/msalamon.pl\/en\/why-stm32\/","title":{"rendered":"Why STM32?"},"content":{"rendered":"\n<p>When choosing to work with ARM microcontrollers, we face the choice of a chip manufacturer. That\u2019s because ARM is a company that \u201conly\u201d designs microprocessor cores and sells licenses for them. Quite an interesting setup, isn\u2019t it? Today, their cores can be found in all the devices we use every day, such as smartphones we can\u2019t live without. Many families <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>of ARM cores have been created. At the moment, two matter: Cortex-A and Cortex-M. \u201cA\u201d means processors for application use (running operating systems). They\u2019re used in the aforementioned smartphones as well as in microcomputers like the Raspberry Pi. What interests us, however, is the Cortex-M family intended for microcontrollers. Within this family we have several types of cores that differ, among other things, in performance. For us, these are the cores:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>M0 \u2013 the cheapest cores with low performance.<\/li>\n\n\n\n<li>M0+ \u2013 an improved version of the M0 core with reduced power consumption.<\/li>\n\n\n\n<li>M3 \u2013 the first Cortex-M core historically. Medium performance.<\/li>\n\n\n\n<li>M4 \u2013 a powerful core with an additional floating-point unit (FPU) and DSP instructions.<\/li>\n\n\n\n<li>M7 \u2013 the newest and most powerful Cortex-M core. A real beast.<\/li>\n<\/ul>\n\n\n\n<p>There\u2019s plenty to choose from, but a core alone won\u2019t get us far. We need that core wrapped with memory and external interfaces. Packaging the core with these components and putting it all into a single package to create the final microcontroller is done by companies specializing in integrated circuits. These include Atmel, Cypress, Freescale, NXP, and of course ST. Since there are so many manufacturers, then\u2026<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Why ST?<\/h1>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Free tools for writing code, compiling it, and flashing the MCU. ST makes sure the most important things are widely available and free. As for the IDE, I recommend SW4STM32. It\u2019s the popular Eclipse modified for ST\u2019s needs.<\/li>\n\n\n\n<li>Dedicated tools from ST. This includes, among others, the STM32CubeMX project skeleton generator. A great tool that speeds up the initial work with a microcontroller.<\/li>\n\n\n\n<li>Free libraries for handling STM32HAL devices. They\u2019re not perfect and can be bloated, but they are great for rapid development. They let you get started quickly without diving into thousands of pages of documentation. Of course, you won\u2019t avoid it! Unfortunately, convenience often comes at the cost of performance, but it\u2019s acceptable.<\/li>\n\n\n\n<li>Free STM32LL libraries. Low-layer libraries (Low Layer) for handling peripherals. Their main principle is \u2013 one function changes only one register. Here you won\u2019t manage without knowing the processor, but the optimization is top-notch.<\/li>\n\n\n\n<li>Most STM32 pins are <em>5V tolerant<\/em>. What does this mean? You don\u2019t have to worry about level shifting when communicating with chips that operate at 5V. You need to check whether the external chip accepts the high logic level driven by the STM32. Most often this will be 3.3V. If it does (and usually it does), then goodbye level shifters.<\/li>\n\n\n\n<li>Rich size and resource portfolio. You can find chips in almost any package. The most popular are TQFP 32, 48, 64, 100, 144 pins. There are even BGAs. Everyone will find something for themselves.<\/li>\n\n\n\n<li>Pin compatibility within the same package in most cases (I painfully experienced one exception). If during development you run out of resources, it\u2019s not a big problem to drop in a more powerful microcontroller in the same footprint.<\/li>\n\n\n\n<li>A huge number of prototyping kits. I love these kits!<\/li>\n\n\n\n<li>A free programmer included with every prototyping board!<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">STM32 microcontroller families<\/h2>\n\n\n\n<p>Across ST\u2019s MCU lineup we have several families, grouped by their capabilities. The graphic below nicely shows all models together with their performance and place in the lineup.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"508\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family.jpg\" alt=\"\" class=\"wp-image-1015\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family.jpg 670w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family-300x227.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family-24x18.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family-36x27.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/msalamon_stm32_family-106x80.jpg 106w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Mainstream \u2013 general-purpose microcontrollers. The most common choice for \u201cordinary\u201d applications\n<ul class=\"wp-block-list\">\n<li>F0 \u2013 an alternative to 8- and 16-bit MCUs based on an M0 core.<\/li>\n\n\n\n<li>G0 \u2013 one of the newer MCU generations with an M0+ core. Intended for low-cost applications<\/li>\n\n\n\n<li>F1 \u2013 the first STM32 family based on the M3 core. High performance and an uncomplicated architecture.<\/li>\n\n\n\n<li>F3 \u2013 a rich offering of analog peripherals. Intended for real-time and industrial applications.<\/li>\n\n\n\n<li>G4 \u2013 another newcomer. High performance combined with a broad range of analog functions.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>High Performance \u2013 the most powerful STM32s used for computation and high data throughput. Very high core clock rates.\n<ul class=\"wp-block-list\">\n<li>F2 \u2013 a performant M3 core with a graphics accelerator. Flash up to 1 Mb; they can have, e.g., Ethernet.<\/li>\n\n\n\n<li>F4 \u2013 further divided into three levels of \u201cadvancement\u201d. They have an M4 core with a floating-point unit. They can include LCD controllers with a graphics accelerator or MIPI support.<\/li>\n\n\n\n<li>F7 \u2013 the latest M7 core. Peripherals similar to the M4. The most powerful single-core STM32s.<\/li>\n\n\n\n<li>H7 \u2013 Dual-core STM32 (M7 as the main core + a slower M4).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Ultra Low Power \u2013 a series focused on the lowest possible power consumption. Lots of additional features that allow sleeping and reducing energy usage.\n<ul class=\"wp-block-list\">\n<li>L0 \u2013 the smallest in the series, starting from 14-pin.\u00a0<\/li>\n\n\n\n<li>L1 \u2013 the counterpart of the F1 in a low-power version.<\/li>\n\n\n\n<li>L4 \u2013 efficient and performant. They include an FPU.<\/li>\n\n\n\n<li>L4+ \u2013 an extension of L4. Larger memories and graphics acceleration.<\/li>\n\n\n\n<li>L5 \u2013 the newest series containing special features for security and encryption. Graphics accelerator.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Wireless \u2013 microcontrollers with built-in wireless support, e.g., Bluetooth 5, 2.4 GHz RF. They are built with two cores \u2013 M4 and M0+<\/li>\n<\/ul>\n\n\n\n<p>For a more extensive description of each series, visit the manufacturer\u2019s site: <a href=\"https:\/\/www.st.com\/en\/microcontrollers-microprocessors\/stm32-32-bit-arm-cortex-mcus.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.st.com\/en\/microcontrollers-microprocessors\/stm32-32-bit-arm-cortex-mcus.html<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">We can choose from development boards labeled as:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<ul class=\"wp-block-list\">\n<li>Discovery \u2013 feature-rich boards \u2013 often with high-performance MCUs \u2013 with several external components. Components used include accelerometers, gyroscopes, microphones, displays, etc. I rarely use them because I don\u2019t always need these components, and they can get in the way.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\n<ul class=\"wp-block-list\">\n<li>Nucleo \u2013 minimalist boards somewhat reminiscent of Arduino. They generally only have the MCU together with the components required for correct operation, plus a single LED and a button. All microcontroller pins are broken out to pin headers. This is my favorite choice. Nucleo, in turn, comes in three sizes:<br>\n<ul class=\"wp-block-list\">\n<li>Nucleo-32 \u2013 about the size of an Arduino mini and the connectors are compatible with it. Small, 32-pin MCUs. Ideal to plug permanently into a small project.<\/li>\n\n\n\n<li>Nucleo-64 \u2013 probably the most popular type. 64-pin MCU. In addition to pin headers with all signals, it has an Arduino Uno\u2013compatible connector.<\/li>\n\n\n\n<li>Nucleo-144 \u2013 the largest of the bunch. It carries a hefty block with as many as 144 pins, and all of that is broken out to pin headers! Next to it there\u2019s also an Arduino Uno connector. USB OTG is available, and here ST even decided to add an Ethernet connector in some versions.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-nucleo\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=dlaczegostm32&amp;utm_content=nucleo\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"400\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner.jpg\" alt=\"\" class=\"wp-image-1593\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner.jpg 1200w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-768x256.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Besides ST\u2019s original boards, there are many others available on the market, mostly from the Far East. Very popular is the board with an STM32F103C8T6 in an Arduino mini form factor. It costs <strong>only a dozen or so zlotys<\/strong>!<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/produkt\/stm32f103c8t6-dev-board-2\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=dlaczegostm32&amp;utm_content=Text\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-1024x341.jpg\" alt=\"\" class=\"wp-image-953\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-768x256.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-24x8.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-36x12.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner-160x53.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BluePill_baner.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hello, hello! But what about the programmer?!<\/h2>\n\n\n\n<p>It\u2019s there! Every development board comes with an ST-LinkV2 on board. I\u2019ll talk about what this chip can do another time, because it\u2019s not only for programming the MCU. We communicate with ST-Link via mini-USB. In the kits you\u2019ll find it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Discovery \u2013 Mixed in with the other components on the PCB<\/li>\n\n\n\n<li>Nucleo-32 \u2013 On the underside of the PCB, also mixed in with the components.<\/li>\n\n\n\n<li>Nucleo-64 \u2013 The top part of the PCB. Here \u2013 note \u2013 it\u2019s breakable. After the final programming, when it\u2019s no longer needed, you can snap it off from the Nucleo and use it separately! The remaining part of the Nucleo can be placed, for example, in the device you\u2019re designing. Awesome, isn\u2019t it?<\/li>\n\n\n\n<li>Nucleo-144 \u2013 Identical to Nucleo-64.<\/li>\n<\/ul>\n\n\n\n<p>Admit that everything I wrote above sounds convincing. They convinced me!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My ST collection<\/h2>\n\n\n\n<p>In my drawer I have several boards I work with, and they will be the basis for posts about STM32.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Nucleo-32 with STM32L031K6T6<\/li>\n\n\n\n<li>Nucleo-64 with STM32L053R8T6<\/li>\n\n\n\n<li>Nucleo-64 with STM32F401RET6<\/li>\n\n\n\n<li>Nucleo-64 with STM32L476RGT6U<\/li>\n\n\n\n<li>Nucleo-144 with STM32F767ZIT6<\/li>\n\n\n\n<li>Discovery with STM32F407VGT6<\/li>\n\n\n\n<li>Chinese minimal dev kit with STM32F103C8T6<\/li>\n\n\n\n<li>Several various loose MCUs<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-1024x683.jpg\" alt=\"\" class=\"wp-image-74\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-1024x683.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-300x200.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-768x512.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-1536x1024.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-360x240.jpg 360w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-24x16.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-36x24.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612-120x80.jpg 120w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/IMG_7612.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>I deliberately didn\u2019t write about the downsides of ST\u2019s solutions. I encourage a courteous discussion in the comments. I\u2019d love to hear your opinion about ST microcontrollers, including the drawbacks you see. Remember to write in correct Polish, not attack other participants, and not to swear.<\/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;4365&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;Why STM32?&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>When choosing to work with ARM microcontrollers, we face the choice of a chip manufacturer. That\u2019s because ARM is a company that \u201conly\u201d designs microprocessor cores and sells licenses for them. Quite an interesting setup, isn\u2019t it? Today, their cores can be found in all the devices we use every [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2912,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[160],"tags":[175,176,174,177],"class_list":["post-4365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stm32","tag-electronics","tag-programming","tag-stm32","tag-stm32cubemx"],"_links":{"self":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4365","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=4365"}],"version-history":[{"count":3,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4365\/revisions"}],"predecessor-version":[{"id":4474,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4365\/revisions\/4474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media\/2912"}],"wp:attachment":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media?parent=4365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/categories?post=4365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/tags?post=4365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}