This part of the site is now the Primary. The original site is still available for reference at - caggius.wordpress.com
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.
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, with the exception of creating your own Marlin Configuration files, this can all be completed in less than hour.
Good News! All of the following is still working fine on a 10 year old i3 laptop and my Ryzen 5 3600 as of January 2021.
Download the compiler (Approx 55Mb).
Go to https://code.visualstudio.com and press the download link.
Install the compiler
Run the VSCodeUserSetup…. file
Accept the T’s&C’S
Accept the Folder
Accept the Shortcuts
Finish
Start the Compiler
Double Click on the Visual Studio Code Icon on the desktop
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.
Wait a minute or two and VSCode should show “PlatformIO IDE installed successfully” and “Please Restart VSCode.
”Go ahead and Close VSCode (File -> Exit).
Download the Latest Marlin Source Zip File (Approx 13Mb).
Go to http://marlinfw.org/meta/downloadClick on the “Download” ButtonClick on “2.0.x.zip” this will be the latest stable release.
Avoid the nightly builds as they often introduce bugs.
Once the download is complete, open the Downloads folder in Explorer (Ctrl+E)
Right Click on the “Marlin-2.0.x.zip” 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. M2072-0118 then I would relocate the folder to the root directory C:\ in order to shorten the filename path lengths in the compiler.
Note: 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.
Restart VSCode and load the Marlin Project
Double click on the Visual Studio Code Icon on the Desktop and 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.
Expand the PIO Home Tree (click on the ">'PIO Home") and select "Open"
Under “Quick Access” select “Open Project”
In the “Open PlatformIO Project” Window Navigate to your Marlin Directory (in my case C:\Marlin\M2072-0118)
Scroll the Window down to show the Open "M207-0118" button and click on it.
Validate the Installation by building with the default Mega2560 processor.
First build 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 our 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
On an Pentium 987 this takes 9 minutes on an old i3 under 2 minutes and a modern Ryzen 3600 less than 12 Seconds.
If successful there will be “===== 1 succeeded on 00:01:48.498 =====” 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 scroll the build window to the top and then find the first red line and copy it to facebook and ask for help!
Check the LPC1768/9 libraries by rebuilding with the correct LPC1768/9 Processor
Open the platformio.ini file in VSCodeIn 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 21)
Change the line “default_envs = megatmega2560” to read
for the SKR 1.3 or SKR1.4 to “default_envs = LPC1768” or
for the SKR 1.4 Turbo to “default_envs = LPC1769"
Save the file (File->Save) or (Ctrl+S)
Expand the ">Marlin Folder" and open the Marlin configuration.h file in VSCode (as above)
Search for MOTHERBOARD (approximately line 130)
Change the line “MOTHERBOARD BOARD_RAMPS_14_EFB” to read
for SKR 1.3 “MOTHERBOARD BOARD_BTT_SKR_V1_3”
for SKR 1.4 “MOTHERBOARD BOARD_BTT_SKR_V1_4 ”
for SKR 1.4 Turbo “MOTHERBOARD BOARD_BTT_SKR_V1_4_TURBO”
Save the file (File->Save) or (Ctrl+S)
Now click on the Tick Icon in the bottom blue toolbar to start the build
If you have a slow machine go make a coffee – on my daughters Windows 8GB Pentium 987 this took 14 minutes.
Once again if successful there will be ““===== 1 succeeded on 00:xx:xx.xxx =====”” showing in the build window
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. Though I would also recommend breaking this step into several stages if you can.
For some reason the first time I recompiled the changes on the big Ryzen machine it failed with some warnings of library conflicts on TMCStepper and U8glib and then a compile failure. The 10 year old i3 laptop worked 1st time. I have seen this numerous times and have no idea why it happens. The only difference I made between the two machines was that I closed and restarted VSCode in between the builds on the i3.
The simplest fix that I have found for most of these compile type errors is to delete the existing project folder and to start afresh with another clean copy of Marlin, change platformio.ini again and then add the two fully updated configuration files to Marlin. Don't ask me why but I could then hit the Tick for a fresh build that worked.
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>.pio>build>LPC1768