STM32 Guide #1: Your first STM32 dev board

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

This is awesome! I just bought an STM32!!! Thanks for making this

👍︎︎ 2 👤︎︎ u/forgotmytea 📅︎︎ Dec 06 2020 🗫︎ replies

Great video!

👍︎︎ 2 👤︎︎ u/thehealthycoder 📅︎︎ Dec 06 2020 🗫︎ replies
Captions
greetings everyone and welcome back let's learn stm32 so i use the stm32 there's a ton of cool things about it ranging from being fast to having tons of fancy peripherals but really my number one reason is that it wasn't batmal now this isn't to say anything bad about atmel it's just all i really knew i felt that it was time to branch out and learn something new so whatever the reason is that you're here hopefully this will get you kicked off in the right direction i decided to get started the same way i did for arduino it's fairly universal that everyone gets started with the arduino uno it's a great beginner board and there's tons of resources out there to help you get started so i already knew how to buy the arduino so let's just go buy the stm32 right this is where i began to feel a little overwhelmed there's tons of recommended boards and they all look completely different some are super simple and some look incredibly complex so which one do i get started with are there differences between them why does one look so simple and the other one has so many other components at this point i just wanted someone to tell me what to pick so that way i could get my feet wet and then make my own decisions later maybe reddit has the answer this is the first post that shows up when i'm asking which board of stm32 i should buy but the responses are all mixed we have stm32f3discovery the bluepillboard nuclio boards the f-zero or l0 series i want to take a second to go over some of the popular dev boards and also touch on some of the variants like what does cortex m0 mean what's the difference between f0 and l0 and why do i keep seeing f0 through f4 that being said i've only done some light research and i've only gotten a chance to use the blue pill and nucleo myself so for the most part this is just my first impression of these boards first up on the list we have the blue pill which is also known as the stm32f103c8t6 this is by far the most popular one that shows up when i'm searching for starter stm32s and honestly i think it's just because it has a nickname bluepill unlike arduino stm32s don't really have a whole lot of nicknames they're almost always referred to by the part number themself but the part number tells us a lot about the chip i think the most important parts are these first few digits here the f-103 and everything after that is kind of more of the technicalities like how many pins there are or what the footprint looks like so it's pretty common to see people reference shorter part numbers to abbreviate or generalize them the blue pill rocks cortex m3 architecture more on that later it's a very minimalist design meaning there's just the micro controller and not much else on this board it touts that it has arduino support meaning that you can program this using the arduino programming language and the arduino ide if you really want and these things are incredibly cheap you can get them for about two to four dollars and after working with arduino for a long time the specs on this blew me away it's pretty much better or faster in every category so after seeing this i of course had to go get one myself so if you're already comfortable with the arduino ide and programming language and you really just want a performance boost you can pick one of these up and get started pretty easily the chip comes with a pre-installed bootloader to make it really easy to hook up over usb and program it for your first time through the arduino ide however i wanted to be able to buy a blank chip and put it on my own custom circuit board so i wanted to know what it would take to program this without the built-in boot loader so to program this without using the bootloader that's built in you're going to need a programmer such as the st-link v2 if you're coming from a background in arduino programmers might be new to you i cover what programmers are and how to use them with arduino in one of my previous videos you're welcome to go back and watch it if you'd like but i'm going to cover everything that you need to know in this series i'm going to recommend the stlink v2 which is the only programmer i've personally used it's pretty cheap and you can get it just about anywhere for the time being the only thing that you need to know about a programmer is it's a special piece of electronics that's able to erase and reprogram the microcontroller you've probably heard the word bootloader thrown around here and there and that's really just code that lives on the microcontroller and it allows you to reprogram itself using some other methods so you could plug in a usb cable or a serial cable and transmit data and the chip would reprogram itself it's not uncommon for a dev board to come with a bootloader pre-installed but blank chips will not since i'm taking a bare metal approach i'm going to be using a programmer for this series next up we have the stm32 discovery boards now unlike the blue pill this is not a specific board this is more of a family of boards the purpose of the discovery boards is to kind of give you all of the tools that you need in order to get started with a new chip this specific board is the f-100 which is awfully similar to the f-103 which is what we saw with the blue pill so this discovery board and the blue pill itself are pretty similar one thing that the discovery boards have that the blue pill does not is a built-in st-link v2 programmer that means that you don't need one of these to program it even if the chip was blank they even draw a little line over here to show you where the st-link v2 stops and then the actual microcontroller stuff starts there are tons of different variants of the discovery boards but pretty much all of them come with a built-in programmer some user programmable buttons and leds and some of the fancier boards give you fun things to play with like microphones or accelerometers or in this case an entire screen since discovery is more of a family of boards rather than a specific development board i can't really give you any of the specs generally these fall in the 10 to 30 dollar price range though i haven't used one of these myself yet but i'm really itching to get my hands on one next up we have the nucleo series which is another family of boards just like the discovery there's a few different variants of the nucleo boards like the nucleo 64 the 144 and the 32 and i'm fairly certain that the only difference between these are the form factors the only ones i've used are two of the nucleo 64 series boards that are both slightly different one of the interesting things about the nucleo 64 is that it has the arduino pin out on it now i haven't gotten a chance to take advantage of this myself but it does look like all the pins seem to line up in a way that would make it arduino compatible this would be useful for things like shields or hats that are compatible with the arduino just like the discovery they put in a built-in programmer on the top this time they really drew a lot of attention to making sure that you realize that the st-link v2 is separate from the main microcontroller because they added the ability to snap it in half to separate the two i'm not gonna lie it's been really tempting to snap this off i'm fairly certain that i could snap this off and still use it normally but i haven't had the guts to do it quite yet maybe i'll do it on a video sometime to satisfy the urge just like the discovery boards there's also a user programmable button over here and also an led somewhere in this area these boards tend to be about 10 to 25 dollars a piece and if you're curious the boards that i have are the nucleo g071rb and the nucleo f446re the last thing on my list are the eval or evaluation boards these things are incredibly overkill they're designed to showcase as many of the features as possible so they add all of the bells and whistles that you could possibly want so for example if the chip can drive hdmi you can expect there to be an hdmi port on here these things pack a massive punch but that being said they cost around 200 to 600 each out of everything that i listed today this is probably the only one that i wouldn't recommend to get started with stm32 this is more geared towards people that are really trying to make the most out of their stm32 cool so now we have an idea of what development boards there are but now we need to learn about the microcontroller that's on the board st's website breaks this down into three main categories we have high performance mainstream and ultra low power they have a chart that looks like this for all of the three categories these charts give us a high level overview of what each microcontroller has to offer on the left hand side we see each of the variants of microcontroller that fall into the high performance category next we have the mainstream category which is what all of these microcontrollers fall into and finally we have the low power which i'll start with the letter l if we look at the microcontroller's part number we can see this letter that comes directly after stm32 this tells us what type of microcontroller it is f is used for the foundation and sometimes high performance g represents mainstream l is low power h is high performance and w which i haven't shown here is for wireless the number that comes directly after the type is the core this number represents what type of cortex m this microcontroller is using if you're curious this is what they represent but it's not terribly important so what is this cortex-m wikipedia does a fantastic job of describing it there's this company called arm holdings they create standards which decide what microcontrollers are allowed to be considered arm cortex m this is really convenient because it means that you can use the same compiler for different brands of microcontrollers for comparison arduino uses atmel's atmega328 and this is built on avr which is something that atmel came up with themselves this just means that you need a specific compiler for avr microcontrollers if you're just getting started this stuff doesn't really matter to you this is a breakdown of what each category looks like and what features need to be implemented additionally arm holdings defines the instruction set that each microcontroller needs to implement if you're using a compiled language like c this is something that you don't have to worry about because the compiler takes care of this for you however if you did want to program something in assembly you would have to understand which instructions are available to you okay that's a lot of information so what do i pick if you're asking me for a recommendation i say start with something with a built-in programmer it saves you the hassle of wiring everything up in terms of the cortex m series it really doesn't matter most of the compilers will hide all of that from you and then in terms of low power or high performance unless you have a project in mind that really doesn't matter either if you're feeling lazy just search for stm32 nucleo and get whatever shows up first and that's what i did i just searched stm32 nucleo on amazon and picked out the f446 because it was the first one that showed up maybe you already have a project in mind so you want to be a little bit more specific about the microcontroller you pick that's actually the reason why i got this board first and then got one that's almost identical to it afterwards the second board the g071 has can fd support which fit one of the projects that i was working on at the time so if you have something really specific in mind that you want the micro controller to have then you can download the stm32 part finder from st's website they also integrated this part finder into their ide so i'll show you how that works i already have the ide installed on my computer so i'm just going to use the part finder that's built in so the way that i do that here is to create a new project by going to file new stm32 project at this point the ide and standalone version of this program look nearly identical if you're looking for something specific i like to look in the mcu selector go to the peripheral drop down and select anything that you absolutely must have so maybe i need something that has at least two can buses and two i squared c buses i've now narrowed my search down to 333 items unless you're looking for a specific microcontroller that you want stand-alone you're probably looking for a development board and you can click on this right here the board selection click on that twice and it will sort by all the things that have boards this is where those eval and disco and nucleo things come into play for example if we click on one of these eval boards like this we're going to see that it is very expensive so unless you want to drop 560 on this i'd suggest picking something else so let's see if we can find something else like a discovery board might be okay but i'm going to look for a nucleo board and here we go we have all the nucleo boards hey and this part number looks familiar this is the one that i got the 446 re so if you click on that it tells us the marketing status maybe it's obsolete or active in this case it says it's about 14 bucks i only recommend this method if you're looking for something that will very specifically meet your needs for example amazon is not going to have every single variant of the stm32 nucleo boards so you might have to go buy them from very specific places so once again if you do need this specific board we can then search for the nuclio f446re from wherever we get our electronics so for example if you like mouser we can just search for the f446re and scroll down and find the nucleo board here we go they're 14 a piece from mouser and that's all for today i hope this video made it a little less overwhelming to pick your first microcontroller pretty much anything that you go with is going to be just fine i'll most likely be using the nucleo and blue pill board since those are the two that i have but i don't think you'll have any problems if you go with something different and to anyone who has more experience than me i'm curious to see which boards you recommend let me know in the comments of this video what you recommend and for everyone getting their first board let me know in the comments which one you decided to go with and why you went with it for my next video i'm planning on trying to make it less overwhelming to jump into ides and tool chains and code generators so that's all see ya
Info
Channel: Mitch Davis
Views: 32,206
Rating: 4.9756308 out of 5
Keywords:
Id: rfBeq-Fu0hc
Channel Id: undefined
Length: 12min 12sec (732 seconds)
Published: Sat Dec 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.