Marlin Firmware - VScode PlatformIO Install - Build Basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Today I'm going to talk about how to install VScode so you can install your Marlin firmware on   your board so I'm going to show you two  examples now the first one on the left   is actually the BigTreeTech GTR version 1.0  on the right hand side we have the RAMPS 1.4 now there's something you need to understand  in order to do this in VScode everything is   organized by the MCU or the Micro Controller  Unit and as you can see the microcontroller   unit on this 32-bit processor is actually  an ARM(s) processor because it says arms   on it now on this one it's a little bit more  confusing because you make two boards together   so what you'll see right here is the actual  8-bit processor for the uh at MEGA2560. so   if I zoom in I can show you a little bit  more in detail what we need to watch for   so zooming in on this board you can see  that I've highlighted the STM32F407 the reason that I'm pointing that out is  because it's going to vary between the   boards so you need to know who manufactured  the board and what the name of the board is   so on the right I've highlighted the GTR  version 1.0 so you can keep that in mind as well   so let me show you the other board real quick  so if I zoom in on this one you can see it   even though it's upside down that it says at MEGA2560. So let me rotate this around so you can see   so there is the processor that is the MCU for  this sport so if I zoom out real quick here   I'm going to have to mate this board back together   and I've done tutorials on this board before  so there's a Basics tutorial but keep in mind   that the environment that I did this in when I was  working with this actual board was in the Arduino   MEGA2560 or the Arduino IDE this being VScode  will do both so let's go over and figure out how   to install it now so if I go over to my desktop as  you can see right here it says Visual Studios code   now what we're going to have to do to install  this is figure out what our chipset is so if I   click on our folder here you can see that I've  already downloaded one I'm going to delete this   for a second and I'm going to show you a couple  of quick things if you can't see file extensions   in your configuration for an instance you see new  text file for a notepad file if you were to right   click on this you'd see the properties say that  it's a txt file the reason I'm showing you this   is because it's going to be important when you're  working with this to see file extensions so I'm going   to click on options and on options what I'm going  to do is I'm going to go to view and in here it   says hide extensions for known file types so I'm  going to click on that to remove it and apply now   you can see the actual file extension this is  very important in this conceptually you'll see   later on why so I'll click OK and then I'm  going to delete this file real quick here   so I'm going to highlight it and hit delete okay and the other thing I want to show you is how  to figure out what your computer type is because   I'm working in Windows so inside windows I'm going  to right click and I'm going to go to properties   and as you can see here it's saying that I have  an AMD type processor but down here it says I'm   working with the 64-bit operating system so it's  x64 based processor so keep that in mind this   will make sense in just a few seconds so I'm going  to open this up and inside here I have to find the   x64 based installer so I'm going to click on this  it's going to download it right over here and this   will take a few seconds to actually pull down so  what we'll do is we'll look over here and wait for   it so this is the actual download process and you  can see that it's populating down here so now that   this is complete to install it all you would need  to do normally is double click if that doesn't   work you'll have to go with run as administrator  and say yes so I'm going to double click it's   probably going to give me a pop-up saying do you  want to do this I'm going to say yes and then the   installer will come up and inside the installer  I'll click accept the agreement I'll click next   this is the file path to where it's going  to be stored on the hard drive so go next   this is going to be the name of it in the start  menu so I'll do next and then I'm going to create   a desktop icon so that if it's on my desktop  I can double click on it and open it that way   so next and then install so this should be pretty  quick the next thing we're going to have to do   after this is actually go to the Marlin firmware  website so I already have it up the program's   opening as we speak so I'll click over here  and as you can see I have the Marlin firmware   website right here which is marlinfw.org so we're going to install the download for Marlin 2.1.2.1 So we'll click on that this will bring us  over to the Marlin downloads this is the one you   want to work with when you're working with either  8-bit which is the AVR right here or the 32-bit   such as ARM(s) so there will be other variations  on this but everything should be in here unless   it's brand new so to download it you'll click the  zip file it'll pull it to your downloads folder   and what will happen is once that is downloaded  we can extract it notice how it says ".zip" so   we'll click over here it's already opened the  folder but it hasn't extracted it so I'm going   to go back to the downloads folder right click  and then say extract all we'll get a pop-up menu   that will say where do you want to put this we're  going to put it exactly where we're working so   we'll extract it this will take a few moments to  actually finish so it's basically expanding out   this file that's been zipped up once this is  completed I can show you the actual installs   so while this is extracting what I'll do is I'll  go over to the Marlin webpage and point out some   other things these down here are for development  they're nightly builds called bug fix it doesn't   mean your bug is fixed it means they're working  on developing a new platform for another release   so these are not valid to use in a normal  configuration unless you're doing development   and then of course there's patches  which I say stay completely away from   but there's also over here configurations now  configurations is a misnomer and that when   you click on it what you'll see is inside the  config file for examples example configurations   for instance you'll see the example configuration  for Creality keep in mind that these are examples   they're not configurations so if you were to  use them what you need to do is in this case   it has a board in here you would copy these two  into your current configuration in order to do   that you'd be in here but because we can't  do it at the moment I'm going to go back   over for a second and show you what happens  so if we go back over here to configuration we can click the download for an extractable  zip so this will pull it to your computer   I do not suggest doing this unless you know what  you're doing in future tutorials I'll talk about   it a little bit more but what I'm trying to say  is this will cause a lot more confusion depending   upon the hardware you're working with so I'm going  to extract this real quick here and I'm going to   point out what you would need to do if you were  going to do it so this will take a second more to   actually extract but what we want to do is we'd  copy the configuration.h and the configuration_adv.h  which is the header file into  here so I'll show you where it's located just   so you know so over in here it's going to be right  here these two files will be replaced by the files   that you would extract from here now these are not  stable configurations these are just examples so I   need you to realize that they don't work out  of the gate there's usually issues with them   so hopefully if you watch my tutorials in  my playlist you'll see how to actually deal   with the configuration files and have  a better understanding of what to do   so let's go back over to vs code inside VScode  we have to set up the environment now there's   two ways to actually open the folder that you're  working with first way is to go to file and then   say open folder the other way is to click here  where you see these double files on top of each   other an open folder so we'll go to the downloads  folder then we'll go to 2.1.2.1 the first time   then the second time then select folder now the  cool thing that they've added to this is it will   install your environment for you now over in  here otherwise if it doesn't install PlatformIO   for you you can always click over here and what  you can do is you can type in PlatformIO IDE  and install it currently it's  installed automatically if it doesn't install   automatically you just click install so now that  we've got that sorted out let's go back over   to the environment we're in now I've used two  boards as an example here the first boards   the default setting for the files that you  would need to install on the RAMPS one point   four so what I'm going to do is show you why  it's the default if we go over to Marlin then we   go over to configuration.h and we scroll down to  Board_RAMPS_14_EFB which stands for Extruder Fan and Bed you can  see what the default settings are also the default   settings for the MCU are in the MEGA2560 folder  so I'm going to show you how to do this real quick   this essentially is just a regular build it should  build automatically without issue just by clicking   the build button which is the check box over  here now there is also Marlin Auto build that   will possibly be installed in your configuration  if not you could always go over here and type   Marlin and it will show you Auto Build where you  can click install and this will install the actual   extension to use it so this is one way you can  build by clicking the build button I prefer not   to use this message or this method because this  button is exactly the same also I don't know what   upload is but that's probably this one right  here for upload so you can see the association   these are just pointers to this check box and this  upload button so build and upload so this is why I   don't use it it's just the default way to do it  I don't use it at all but if you wish to use it   go right ahead there's actually more buttons down  here for clean and other things so let's go back   over here and what we want to do is actually build  this default configuration to see if it's working   so I'm going to click the build button right  here and essentially what's happening is it's   compiling each of the files needed to build this  and it's putting it inside of here so you can see   the MEGA2560 it will build the firmware hex file  now the hex files hexadecimal and this will point   to a particular place in memory on the board that  you're working with so let me show you the install   real quick if I go over to the actual desktop and  I plug this in hopefully it'll power up no problem so let me power it up real quick so as you can  see it's now powered there's actually flashing   lights underneath it's hard for you to see them  so I would turn it on its side to show you but   if you have this board you'll see it so to do  an upload we can go back over to the desktop   and we can actually click the upload button  to push it directly over so let's click this   and then watch the board so I clicked it it's  building again but it should be quicker and   now it's trying to upload so what's occurring is  it's flashing it to the actual board in question   under the hood so you can see the flashing  light that is the actual load occurring now if   we go back over to the actual desktop you can see  what's occurring here it's actually populating it   I wanted you to see this because that's what  upload looks like now on a 32-bit board it's   going to be different we're going to have  to use an SD card so if we go back over here   I'm going to pop up this card right here and I'm  going to place this in the actual card reader   so one of the other things I need to do is reset  this jumper because I need to show you something   in a second but let me plug this in the computer  you might hear a beep and let's go back over to   the desktop so on the desktop in this case we  want to use the actual STM32F407 which is on   the MCU but first we have to locate our board so  in order to do this we have to go back over to   The Source folder then the core folder  then boards.h inside boards.h will search on   sorry about that we'll search on GTR_V1  that's the type of board that we're working with   by BigTreeTech so I'm going to highlight  it right click and I'm going to copy it   so now I'm going to minimize the source and  core that I have in here go back over to   configuration.h highlight where the RAMPS is paste  our configuration now there is a difference with   the ramps we had to be at zero in order to do our  upload because that's how it connects in this case   the board that we're working with we need to do  negative one now the reason I do it on the first   serial Port is because that's the motherboard  normally you could also do it on this down here   for either the second or the third serial Port  but because I'm using this is the motherboard   I'm gonna have to change this number in the  future when I'm using something such as a   TFT display or a Thin Film Transistor display so  that's why I reserved this for the actual display   so now that we have that set we can't build  yet I'll show you what happens if we try if   we click the build button we're going to get  an error and what's going to happen is it's   going to say that uh it's a MEGA2560 and  it's incompatible with this board type so   what we need to do is go over to the ini folder  find our chipset for our MCU in this case it's STM32F4 click on that and then we're going to  search on GTR_V1 now here is the   actual configuration for this board in question  that we need for the environment so we'll copy   that obviously it varies between the boards that  you're working for or with for your ini that's why   I'm pointing that out so now we have to change our  default environment so I'm going to paste it here   and that's going to be for our board now what I'm  going to do is actually clean because we already   did an actual build for something else up here so  I'll show you what happens when you clean it will   actually clear out the ".pio" folder so that we  don't have the incorrect build in there and then   it will set up the BigTreeTech GTR build now  keep in mind if you were to use Marlin Auto build   it will in theory populate this let's see if it  works whoop I gotta click over here so it senses   what the board is so we can do a build here but  we can't do an upload because that doesn't exist   although this functionality is coming online  in the future so I'll do a tutorial on it when   it's stable so in this case I'm going to do the  build over here even though the same thing occurs   here so if you click here it essentially  will do the build that you're doing here   so you can watch what's going on in the terminal  but you won't see as much so you notice how you're   not getting everything that you're looking  for so the reason I like using this one is   to show you what's actually in it this one's  doing it apparently silently in the background   so what we're going to have to do in a second when  this completes is actually show you the other way   so these yellow things that you're seeing here are  actually warnings if you see red that means it's   an actual failure now the cool thing about Marlin  Auto Build is it will bring you to the folder that   you're working with now normally I don't show you  how to do it this way so I'm going to show you the   other way real quick if we actually click build  over here you'll see the difference so if I'm   building down here you can see everything that's  occurring with the actual build and what it's   reaching out to get so it's now almost completed  its build and the build can be found right here   in the ".pio" folder and it's located right  here so essentially what the auto build doing   in this case is it's revealing in File Explorer  for you automatically so you can now right click   on this and send it to your E-drive but I have to  point out with the E Drive this was the last known   good build you can see it's 84 kilobytes but I'm  going to delete this so I can show you something   so I'm going to take that out in order to format  this you're going to have to click format and it's   going to have to be FAT or FAT32 for the filing  system it's File Allocation Table in this case   32-bit I believe and the other one doesn't show  up here right now but you cannot use NTFS which   is New Technology File System or Extended FAT  they do not work so it's either FAT or FAT32   so we already have that formatted as FAT32  so let's go back over to the other folder   for a second right click here and send it to the e  Drive so normally if this works it'll convert this   name to FIRMWARE.CUR in capital letters  but sometimes I'm brand new boards the first   time you do it it does not work so the workaround  for that is to open a new file in this case we're   going to open a text file it's going to have zero  kilobytes and we're going to rename it to FIRMWARE.CUR   in capital letters  and that way if it does fail   or it won't probably fail it should load no  problem but if it works this file be renamed   to this if you ever want to use this file for  another configuration that's the same Hardware   you'll rename FIRMWARE.CUR to firmware.bin  in lowercase and by the way bin means binary file   so let's go back over to the desk I'm going  to pop out the drive now I got to show you   something on this board other boards  will vary but in this particular one   there's an issue where if I plug in the USB it  will not power the board automatically it will   show Power on this cable so you see a red light  but you don't see a firmware load the reason for   that on this particular board other boards  will vary is that the jump jumper needs to   be in the USB position when you're using this  type of board you're going to put it back when   using steppers because it causes resets this  is only to show you in the example so what's   the flashing so you can see the flashing light  to the left of the MCU and then you hear a ding   on the computer so in order to test this I'm  going to show you real quick in Pronterface so in Pronterface as you can see right here it  says the COM Port is one that's confusing this   by the way this software is not really used for  printing anymore I use it more for troubleshooting   if you were to use a regular software where  you want to get responses back from your   actual board I would suggest using something like  Octoprint or Klipper with another type of firmware   so Klipper will not work with Marlin but it  does work or excuse me Klipper and Marlin are   two different firmwares Klipper will only work  for other things that are similar to Octoprint   but I'll show you what I mean by g-codes but first  we need to connect to it so in this case there's   a COM 6 but we don't know if that's our board so  we're going to click over here and we're going   to find Device Manager and when device manager  comes up you can see that we have ports we're   going to have to expand this out and as you can  see there's a COM Port one and then there's an   STM microelectronics virtual COM Port if this  doesn't show up and it shows up as like an orange   square or excuse me triangle with a exclamation  point in it you may need to click here and then   scan for Hardware Windows is pretty good about  finding it for you and setting it up if you   do have an issue there's always my Discord it's  totally free just remember that I have 1400 people   in there asking questions so I may not answer  your question but other people are willing to help   so I'm going to close this and now I'm going to  go over here and I'm going to click on COM Port   6. let me show you what happens on comport one  real quick because it's not our Port we'll connect   we get nothing if we connect with COM Port  6 it connects to the printer so what we need   to learn from this is if we go over to here  you can see that there's no end stops on this   board currently so if we were to connect to it  they would say triggered and I'll show you why   if I go back over to the regular desktop for  a second and use a g code which is a code to   communicate with the actual printer and get  responses or move it I'm going to type M119   and what this is is for is actually saying  what are the state of the end stops so I'm   going to hit enter and as you can see they all say  triggered because nothing is connected currently   so if you like my tutorial please press the like  button and subscribe and to my Patrons I will   place a thank you note at the end of the video  for both the patrons and PayPal people that make   donations to keep this going and everyone take  care be safe and remember to Like and Subscribe
Info
Channel: Ed's 3d Tech
Views: 10,589
Rating: undefined out of 5
Keywords: Vscode and platformio install, install platformio vscode, Marlin with VScode, how to use Marlin, Marlin firmware building, Marlin installing, configuring Marlin Firmware, How to use Marlin Firmware, VScode with PlatformIO and Marlin, Compiling with Marlin Firmware, Marlin 2.1.2.1, Marlin v2.1.2.1, marlin version 2.1.2.1, marlin firmware v2.1.2.1, Marlin FW 2.1.2.1, Marlin 2.1
Id: nICJinTdYp8
Channel Id: undefined
Length: 27min 50sec (1670 seconds)
Published: Wed May 31 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.