A Detailed (And Boring) Guide To Install Marlin Firmware Using VSCode
Originally posted on Minimal3DP.com
History of Marlin
Marlin is an open-source firmware for 3D printers that was first developed in 2011 by Erik van der Zalm et. al. The firmware was initially designed for the RepRap project, which aimed to create open-source 3D printers that anyone could build and use.
Marlin quickly gained popularity among the 3D printing community due to its user-friendly interface, easy-to-use configuration options, and active development community. The firmware is known for its reliability, stability, and compatibility with a wide range of 3D printer models.
Over the years, the Marlin firmware has undergone multiple updates, with the latest version being 2.1.x. These updates have brought new features, improved performance, and more accurate printing capabilities to the firmware. The developers behind Marlin continue to actively support and improve the firmware, making it one of the most widely-used and reliable open-source firmware options available for 3D printers.
Marlin has a large, active community of users, developers, and contributors. Many 3D printer manufacturers have also adopted Marlin as their default firmware, and it is supported by many popular 3D printers control boards, such as RAMPS, SKR, and others.
Installing Marlin
Marlin Prerequisites
- A GitHub account.
- GitHub Desktop and Visual Studio Code (VSCode) are installed on your computer.
- “PlatformIO” extension and “Auto Build Marlin” extension for Visual Studio Code
- A formatted SD card with a capacity of at least 4GB for flashing the firmware via an SD card. The SD card could be a full or mini card.
- Knowledge of your printer’s board and the options of the firmware to match them
Marlin Sample Configs
Marlin sample configurations can be found on the Marlin GitHub repository.
The repository contains multiple sample configurations for different Marlin versions, types of 3D printers, and boards, such as RAMPS, RADDS, SKR, and others. The sample configurations are an excellent starting point for configuring Marlin for your 3D printer. The sample configs are well-commented, so you can easily understand the different settings and options available, and modify them as per your printer needs.
You can also check the Marlin official documentation for the configurations and options specific to your board and printer. Board manufacturers will typically maintain sample configurations for their boards as well. Be sure to check any sample config to verify that the desired version and ideal configuration of Marlin are used.
Marlin Install Steps
Note: Before making any changes to the Marlin firmware, make sure to create a backup of the original files in case you need to revert to them later. Make sure to read the documentation and instructions on the Marlin Firmware website carefully before making any changes to the firmware to avoid any potential issues with your 3D printer. Be sure to make note of any saved Marlin settings for use on the new install.
Step 1: Download and Install Software and Extensions
GitHub Desktop
- Go to the GitHub website and click on the “Download for Windows” or “Download for Mac” button, depending on your computer’s operating system.
- Once the download is complete, open the installer and follow the on-screen instructions to install GitHub Desktop on your computer.
VSCode
- Go to the Visual Studio Code website and download the version suited for your computer’s operating system.
- Once the download is complete, open the installer and follow the on-screen instructions to install VSCode on your computer.
PlatformIO
- Open VSCode and click on the “Extensions” icon on the left sidebar or press “Ctrl+Shift+X” (Windows) or “Cmd+Shift+X” (Mac) to open the Extensions pane.
- Search for “PlatformIO” in the Extensions pane and click on the “PlatformIO IDE” extension by “PlatformIO.org” in the search results.
- Click on the “Install” button to begin the installation process.
- Once the installation is complete, a message will appear asking you to restart Visual Studio Code. Click on the “Restart” button to apply the changes.
- After the restart, you will see the “PlatformIO” tab in the sidebar. This means that PlatformIO is ready to use.
Auto Build Marlin
- Install the “Auto Build Marlin” extension by searching for it in the Extensions marketplace and clicking the “install” button.
- Once the extension is installed, open the “Auto Build Marlin” tab in VSCode to verify the install
Step 2: Fork and Clone the Marlin Firmware Repository
- Go to the Marlin GitHub repository
- Click on the “Fork” button in the top-right corner of the page. This will create a copy of the repository in your own GitHub account.
- Once the fork is complete, you will be redirected to your own copy of the repository.
- Open GitHub Desktop.
- Click on the “+” button in the top left corner of the screen and select “Clone repository.”
- In the “Source” field, enter “https://github.com/MarlinFirmware/Marlin" and select a location on your computer where you want to save the repository.
- Click on the “Clone” button to download the Marlin firmware repository to your computer.
Step 3: Configure Marlin Firmware in Visual Studio Code
- Open Visual Studio Code and click on the “File” menu and select “Open Folder” or “Add Folder to Workspace.”
- Navigate to the location where you saved the Marlin firmware repository in step 2 and select the “Marlin” folder.
Step 4: Update and Install Marlin Firmware
- In Visual Studio Code, open the “Configuration.h” file and make any necessary changes to the settings.
- Save the changes you made to the “Configuration.h” file.
- Repeat the above process in the “Configuration_adv.h” file and make any necessary changes to the settings.
- Save the changes you made to the “Configuration_adv.h” file
- Use the “Auto Build Marlin” extension to compile the firmware. Press the “Build” button to start the compilation process.
- The compilation process may take some time, depending on your computer’s hardware and the size of the Marlin firmware. Once the compilation is complete, you will see a message indicating that the process is done.
- Wait for the compilation process to complete.
- Be sure to sync your changes to GitHub
Step 5: Flashing the Firmware
Note: Make sure that the power supply to the printer is stable and uninterrupted during the firmware flashing process as a power failure during the flashing process could damage the board.
- Prepare an SD card by formatting the SD card using the FAT32 file system. If the card has any files on it, make sure to back them up before formatting.
- Copy the firmware compiled in Step 4 to the SD card. The firmware file is named “firmware.bin” for easy identification.
- Turn off the printer.
- Insert the SD card into the printer's SD card slot. The location of the SD card slot may vary depending on the printer model.
- Turn on the printer and enter the firmware flashing mode.
- Once the printer is in firmware flashing mode, it will automatically detect the firmware file on the SD card and begin flashing the firmware.
- The flashing process may take several minutes, depending on the size of the firmware. Wait until the process is complete and the printer restarts.
- After the flashing process is complete, check the firmware version to confirm that the update was successful.
This article is also available on my website.
References
Marlin Firmware Website: https://marlinfw.org/
Marlin GitHub Repository: https://github.com/MarlinFirmware/Marlin
PlatformIO Website: https://platformio.org/
Auto Build Marlin Extension: https://marketplace.visualstudio.com/items?itemName=jeroen.auto-build-marlin
Visual Studio Code Website: https://code.visualstudio.com/
Firmware flashing via SD card: https://www.instructables.com/id/Flashing-Firmware-to-3D-Printers-Using-an-SD-Card/