VSCODE - Edit Marlin Firmware - How To - Chris's Basement

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we're gonna walk through all the steps to set up vs code so you can compile Marlin 2.0 firmware a while back I did a video on Marlin pseudo firmware that's the version that supports 32-bit boards I showed you how to get everything set up compile it get it loaded on your SD card and get everything working well in that video we were using that Adam editor and a few things have changed with Adam and platform IO and they're going in a different direction and if you're using Adam right now you might have seen this warning message basically all it's telling you is platform io going forward the preferred editor is going to be vs code Adam does still work but we should probably try to use vs code going forward if that's the direction that platform IO is going in and after talking with a couple of the community members I realized that maybe it's not as straightforward getting vs code set up to compile Marlin as it should be so that's what we're going to do today we're going to walk through all the steps to get set up on vs code get your Marlin compiled we'll load it on a 32-bit board and we'll do the 8-bit version just for fun you can do either one with vs code it doesn't matter they both work the same so let's head to the computer and get all this set up and here we go so the first thing we're gonna do is we're gonna grab Visual Studio code so we'll open up a browser all the links that I use will be in the description below as usual you can just head to code Visual Studio calm and we'll just hit download for windows downloads complete let's click on the execute to start the install will accept next locations fine next Start menu folder next the only one that I want is this add path that's gonna add it to environment variables so we'll just leave that ticked and hit next well hit install install is complete we can go ahead and launch it hit finish and here's Visual Studio code so we still have to use platform IO as our IDE compiler to compile Marlin so we're still gonna have to add that even though we're using visual code the easiest way to do that is to come over here to extensions and then you can search for platform io and we want this top one platform IO IDE we'll hit install well that's installing let's go out and grab a copy of Marlin so we'll head to Marlin fw org we'll go to downloads and we're gonna grab Marlin 2.0 let's head to downloads and let's extract that well right click extract all and let's call it Marlin 2.0 vs for visual studio we'll hit extract so now we have our Marlin version that we need we can go ahead and close these go back into visual studio the platform IO install is complete and you can get to platform IO right here over on the left with this alien icon so now we need to open up our Marlin project in platform io so we can compile it so let's import arduino project we'll go to our downloads folder we'll click into this vs folder that we created when we extracted it and we'll select the underlying Marlin folder this one here and then we need to select a board Marlin by default still uses ramps so that's a mega 2560 so in this pulldown up here we'll go with the mega 2560 and then we'll hit import now our project has been loaded we can open up the configuration h file this is where you make your config changes but i recommend not changing anything until you build it once we want to build it and make sure it's gonna work also if you open up this platform io ini file you can see the default environment is mega 2560 that's what it's gonna be set to default in Marlin anyway but just note that this is the default for now so back to configuration dot H down here you notice you have all the commands that you can run for platform io the checkmark is build but you can also go to your platform io button over here on the left and it's going to give you all the options that you can run for this project so either way will work but if you come up here and click build down here in the terminal it's going to run through and build your project when the building is done you can scroll back up a bit and you'll see mega 2560 success 47 seconds so we know the software compiles successfully so we've already got V s code installed and platform io and we can compile Marlin now there are a couple of different ways to do this I think it's just easier to go grab the Marlin firmware and do it just like this but you could clone a git project if you'd like you could take the get link you might need the get version for Windows to get some of this stuff done but you can take that link from github or another to where he put it in here and it will pull in the updated files for you again I think it's just as easy to go get the firmware but that's another option that you have so we know ramps works let's actually try to load this on a board so let's go try the iong seaboard so we'll scroll down a little bit here's your motherboard configuration if you need to see what the lists of boards are like we can come up here go back to Explorer and we'll open up the board's file boards is in source core and then just open up boards these are all the boards that Marlin 2.0 currently supports we can scroll down a bit and we'll grab board NC Rambo this one right here let's just copy that and we'll head back to configuration dot H and we'll just paste that right in here now there is a different library for the IT Rambo and the mini Rambo other than the one that ramps uses so we're gonna need that but with platform IO on V s code that makes it pretty easy so let's go ahead and cable up Rin seaboard USB remember Ultima Shane boards you do have to power them up to be able to talk to them USB you can't just power them with that five volt so we only made one change and that's for the int board but we do need to compile for that IC board let's go ahead and say we're configuration now th we'll go to file save and then we'll head back to platform IO and up here in project tasks if you scroll through it's going to have all of your environment variables pre-made for all the boards that Marlin supports so we can come down expand Rambo and we'll hit build from there that will allow us to use the Rambo libraries and when we tried to compile it I see we got some errors because of the drivers weren't set so we can set that really quick just to get it loaded so we'll scroll down a bit and we have the driver section and will uncomment these for X Y Z and E and we'll change all these a four nine eight eighths to TMC 2130 now that change is made we can go ahead and save and under Rambo will hit build again any extra libraries that it might need to be able to build for LCD screens or other things it's going to go ahead and install them as it builds build is complete we'll scroll back up a bit Rambo builds successful and now we can go ahead and upload that build so back over here environment Rambo we'll just hit upload most of the time if you're plugged in USB it's going to be able to find that board especially on 8-bit boards I've noticed and it's going to go ahead and flash that chip so there's an 8-bit board let's go ahead and do a 32-bit board as well we're gonna do the SKR 1.3 so we can just comment these drivers out for now let's go back to our Explorer and we can go back over here to our boards file and get the name of the board that we want to compile and we want the big tree SKR version 1 3 we'll just copy this back to configuration dot h scroll back up to the board config we'll paste over our int rainbow for our sk r and then over here in our environments we can just close our Rambo the sk r is an LPC 1768 so we can expand that one we can go ahead and hit build and the build was successful now if you've never loaded Marlin on your sk r board before onto that SD card the easiest way to get this done is just to take the SD card off the board and load it on your computer the SD card is on you can see the firmware current file you can either delete that or leave it there that's fine it doesn't matter we can go back to vs code and up here in the project tasks we can go ahead and hit upload it should find your SD card just fine mine was the e Drive and it uploaded it now if we take a look at that card again you're going to have your bin file and your current file the bin file is going to get loaded as soon as you mount it on your board and reboot it so remove the SD card put it back on the board and we'll restart the board now that you have a valid configuration on your board you can see your board as a drive letter so our new board is on H now going forward when you build from vs code now that you have a valid configuration and you don't get anything too messed up in there you can just upload from here so back to vs code if you just hit upload again it finds your board as a drive and it reads it automatically now if you want to grab that bin file that's been generated by this compile and load it on the SD card manually or maybe send it to somebody so they can load it you can do that as well we'll go back to Explorer go to Pio build LPC 1768 and this is your current firmware abend file right here you can copy that and paste it wherever you like or put it on the SD card to load it manually and that should be all you need to know to get up and running with vs code and compiling Marlyn so there you go that's how you can use vs code to compile Marlin firmware and get it uploaded on your main board of course you're going to have to tweak some of the configuration files to get everything working correctly for your 3d printer but this should get you started in the right direction on how to use vs code versus atom I hope you like this video you found it helpful if you did please consider giving a thumbs up or subscribe to my channel if not leave your thoughts in the comments below and as always thanks for watching
Info
Channel: Chris Riley
Views: 88,199
Rating: undefined out of 5
Keywords: 3D, printer, Printing, 3D Printing, 3D Printer, ChrisBasement, ChrissBasement, Chris'sBasement, Chris Basement, Chriss Basement, Chris's Basement, ChrisRiley, Chris Riley, benchy, 3dbenchy, 3d, VSCODE - Edit Marlin Firmware - How To - Chris's Basement, Marlin, VSCODE, 2.0, Marling 2.0, firmware
Id: W6zYvRgGr3Q
Channel Id: undefined
Length: 9min 44sec (584 seconds)
Published: Wed Sep 18 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.