Marlin Visual Studio Code

  1. Building Marlin 2.0
  2. Visual Studio Code Auto Build Marlin
  3. Auto Build Marlin

Visual Studio Code (VSCode) & Prerequisites. VSCode Download Page (Windows/Mac/Linux) VSCode Official Setup Documentation; Python Installation Page; TH3D Unified 2 Firmware. Unified 2 Firmware Downloads; Main Github Page for Source Code; Marlin Firmware. Marlin Firmware Download Page; Setting up PlatformIO with VSCode. Without a doubt Setting up the Marlin firmware editor PlatformIO isn’t the most logical for newcomers. Especially as a requirement is to run PlatfomIO via the Microsoft Visual Studio Code software. Nonetheless this guide will see you through the initial steps of setting up PlatformIO to edit the Marlin 2. Truly well done, that is the Marlin 2 firmware fully configured and updated for the Creality Ender 3, Ender 3 V2, or Ender 3 Pro 3D printer with the SKR MINI E3 V2 mainboard. Once again I hope the SKR MINI E3 V2 Marlin 2 Setup Guide was useful, and wish you all the very best.

Universal Code Lines Counter 1.0 (30,346 view) Seccia 0.1 (32,439 view) LineTally 1.0 (24,748 view) Resoor 1.40 (11,041 view) Software Ideas Modeler 3.41 (32,909 view) VB6 Manifest Creator (43,535 view) Home Revision Management System 1.5 (23,755 view) Free Script Processor 4.8 (10,823 view) InstallAware Free for Visual Studio (13,625 view). John Marlin on 06:54 PM. Microsoft Visual Studio Window Dev Center Developer Network TechNet Microsoft developer program.

The existing ANet A8 pages will remain on WordPress as they have been linked by multiple subscribers on Facebook 3D Printing Groups, but they are also mirrored on and as of January 2021 updates are only being applied on the new site.

See for the latest update for Marlin

November 2019 – personally I do not use Windows but for completeness I have just installed the Marlin build environment on my daughters laptop and got it to build the latest Marlin 2.0.x version.

Building Marlin 2.0

You can follow this YouTube Video from Chris Riley, but it is a little downlevel and some of the prompts have changed. So I have written down what I did whilst sort of following the first 3:15 minutes of the video.


My daughters laptop is pretty slow compared to my 2012 I7 Macbook taking 3 times as long to compile ! But if you have a fast Internet connection then this can all be completed in a couple of hours.

  1. Download the compiler (Approx 55Mb).
    Go to and press the download link.
  2. Install the compiler
    Run the VSCodeUserSetup…. file
    Accept the T’s&C’S
    Accept the Folder
    Accept the Shortcuts
    Select Additional Tasks – Create Desktop Icon – Register Code as an Editor
    Complete Install
  3. Start the Compiler
    Double Click on the Visual Studio Code Icon on the desktop
  4. Install the PlatformIO IDE (Integrated Development Environment) Extension
    Click on the Extensions Icon (3+1 Squares) at the bottom of the toolbar in the left hand margin (or just type Ctrl+Shift+X)
    Start typing “Platform IO” in the Search Box
    Once “PlatformIO IDE” appears in the results list then click on the Install Button next to it.
    Go make a Coffee.
    After several minutes VSCode should show “PlatformIO IDE installed successfully” and “Please Restart VSCode.”
    Go ahead and Close VSCode (File -> Exit).
  5. Download the Latest Marlin Source Zip File (Approx 13Mb).
    Go to
    Click on the “Download” Button
    Click on “”
    The download should start.
    Once the download is complete, open the Downloads folder in Explorer (Ctrl+E)
    Right Click on the “” file and select the “Extract All…” option.
    On the “Extract Compressed (Zipped) Files” popup change the destination folder and Target filename to something more suitable. I personally would rename this folder to include the version and download date e.g. Marlin-2053-0611 then I would relocate the folder to the root directory C: in order to shorten the filename path lengths in the compiler.
    Do not use your home directory as Windows is limited to a maximum path length of 260 characters and the Marlin directory tree is already quite long.
    Finish off your Coffee whilst the unzip operation completes.
  6. Restart VSCode and load the Marlin Project
    Double Click on the Visual Studio Code Icon on the Desktop
    Wait until the PlatformIO IDE window opens up.
    If it does not open automatically then click on the Alien Icon in the left hand margin toolbar.
    Under “Quick Access” select “Import Project”
    In the “Import Project” Window
    If the option to “Select a Board” is there then click on it and chose
    “Arduino Mega or Mega 2560 ATMega2560 (Mega2560)” – We will change that to LPC1768 later. If it is not there do not worry – just continue.
    Scroll down to the “Chose a Directory” dialogue and navigate to
    Then Click on the button labelled “Open Marlin-2.0.5”
  7. Validate the Installation by building with the default Mega2560 processor.
    Try building the Marlin project as downloaded. We will not make any changes yet as if it does not compile we will know that the problem is with the installation and not the code changes.
    Click on the Tick Icon in the bottom blue toolbar to start the build.
    Go make another coffee – on my daughters Windows 8GB Pentium 987 it took just under 9 minutes.
    If successful there will be “1 succeeded” showing in the build window
    Note: There may be a few “Problems” shown these will normally be Compiler Warnings for variable type mismatches and can be ignored.
    If there is “1 failed” showing in the build window then call for help on facebook!
  8. Check the LPC1768/9 libraries by rebuilding with the correct LPC1768/9 Processor
    Open the platformio.ini file in VSCode
    In the left hand window click on “>MARLIN-BUGFIX-2.0.” to expand the file tree
    Scroll down to “platformio.ini” and left click on it to open an editor window in VSCode.
    Search for “default_envs” (approximately line 23)
    Change the line “default_envs = megatmega2560” to read
    a) for the SKR 1.3 or SKR1.4 to “default_envs = LPC1768” or
    b) for the SKR 1.4 Turbo to “default_envs = LPC1769”
    Save the file (File->Save) or (Ctrl+S)
    Open the Marlin configuration.h file in VSCode (as above)
    Search for MOTHERBOARD (approximately line 133)
    Change the line “MOTHERBOARD BOARD_RAMPS_14_EFB” to read
    Save the file (File->Save) or (Ctrl+S)
    Now click on the Tick Icon in the bottom blue toolbar to start the build
    Go make another coffee – on my daughters Windows 8GB Pentium 987 this took 14 minutes.
    If successful there will be “1 succeeded” showing in the build window
  9. Update the Marlin Configuration and rebuild
    Now we can go ahead and make the several hundred changes to configuration.h and configuration_adv.h for our own specific design of machine…
    Then hit the Tick for a fresh build.
  10. Upload firmware.bin to SKR
    If your printer is not directly connected to your build computer and the path configured in platform io to automatically download builds; then you will need to manually copy the new build to the printer SDCard. (If you have followed the instructions above you will not have done this yet).
    Note: For the Turbo board replace LPC1768 with LPC1769 below…
    Copy the .pio/build/LPC1768/firmware.bin file to the SKR V1.3 SDCard replace and reboot the printer.
    To find the firmware file in the VSCode file tree on the left expand

In this video, I'll walk you through the steps for configure your PC to compile Marlin 2.0 firmware.

Hello, my name is Daniel, welcome to the CrossLink channel. Our mission is to help 1 million people getting more successful with 3d printing and if you're here for the first time, subscribe and enable bell notifications so you don't miss anything.

So, you wanna compile Marlin 2.0 on your Windows PC, this video is about how to setup your PC to be ready to do that, let's get into the video.

As usual all links to external documentation and software that I'm referring to are linked in the description of this video.

So, first step is to install visual studio code from

Make sure you don't select any of the other options like visual studio full featured or visualstudio for mac. Visual Studio Code is the thing that we want.


So select Download Visual studio code then selecting the Windows x64 installer.

Just a few quick tips while your're doing the installation. I would actually select to enable all these options like open with code for the windows explorer because that will make things easier later if you like to edit code files quickly or start vscode directly from a folder.

After installing visual studio code, you need to launch it for the first time to make the next steps.

Open the extensions tab on the left hand side of the window.

Marlin visual studio code

In the search field, enter 'platformio' and then select 'PlatformIO IDE' from the results list.

Now, click the 'Install' button and wait until the installation process is finished. Don't launch any other installation at the same time and make sure, you don't close visual studio code until it's done installing.

There might be a message saying 'Please restart VSCode' after the installation. If you see this, please close Visual Studio Code and launch it again.

After the installation is finished, click on the extensions tab of visual studio code again and search for the extension 'auto build marlin'.

Install this extension by clicking 'install'.

Now you should have Auto build marlin and PlatformIO IDE in the list of installed extensions.

Next, we wanna do a final check if we can compile Marlin firmware with this setup.

Marlin Visual Studio Code

The contents of your marlin source folder should look similar to this. Here is the platformio.ini file that indicates, this is a platformio project.

Now, there is two ways how you can open this project. First you can just right click anywhere in the whitespace of this folder view and select 'open with code'.

You did select that option during the installation did you?

And the other way to to it is open up visual studio code. Then open the folder tab and click open folder and now you need to navigate to the folder where you just unpacked your Marlin sources and then select the subfolder where the platformio is in and all the other subfolders and then say select folder.

Now finally, open up the Auto Build Marlin tab, that should be here in the left menu shown as a Big 'M'.

And then move your mouse cursor into this upper section to make those different icons visible. So now you can either directly click the build button here in this section or first show the ABM Panel, that's the auto build marlin panel.

Now, depending on the configuration that you might have, there will be different environments available here and if there is more than one environment to select from and you hit that build button, you will also get a notification that you have to select one environment first to compile it.

So for showing this, it's not really important what environment I use, I'm just going to show you what should happen if you click one of the build buttons so let's use the mega2560 as an exampel - Auto Build Marlin will start the corresponding build and should come out with a success message at the end.

Visual Studio Code Auto Build Marlin

So you're now ready to compile Marlin 2.0 on your PC. I've done a bunch of videos about how to configure and upload Marlin 2.0 for different printer models and mainboards on my channel, so check them out if you like.

Auto Build Marlin

Thanks for watching - see you next time