How to build firmware from https://gitlab.com/lulzbot3d/marlin

The last time I build firmware from sources was 1.1.9.34 and I used build-lulzbot-firmware.sh slightly modified to only build for a TAZ 6 and the tool heads I own. I would like to build the current Universal firmware (2.0.9.0.13) for my TAZ 6 along with the latest firmware for the Dual Extruder V3.1 (2.0.0.144?) and the Aerostruder.

I believe this firmware is located at LulzBot 3D / Marlin · GitLab but I can’t find the build script or any documentation on how to prepare my environment. Can you point me in the right direction to get this done?

There won’t be any build scripts for the universal firmware as development is now done with the VSCode editor and PlatformIO build environment. There are a lot of details for setup I don’t remember and can’t look up at the moment, but the main idea is that you have to install VSCode and the PlatformIO extension. Then clone the code for the version you want from GitLab, load the project in VSCode, go to the PlatformIO extension and find your printer in project tasks and pick build there.

If you don’t want to deal with all that it should still be possible to just download the code from Gitlab, open it in the Arduino IDE, select your print and tool head in the config header file, and compile the code like any Arduino project. You can use “Export Compiled Binary” in the Arduino IDE to make the hex or bin file.

Oh, almost forgot, if you want to compile 2.0.0.144.5 or 2.0.0.144.6 that should be done in the Arduino IDE as those versions were not set up to work in VSCode and PlatformIO.

Where is the source code for 2.0.0.144.5 or 6?

On the GitLab page you should be able to select the version through the dropdown menu pictured in the below image.

Here’s a link to a document with a bit better info on how to set up the VSCode development environment to compile the universal firmware:

But, again, you can’t use VSCode to compile 144.5 and 6. Well, I shouldn’t say can’t, someone skilled with VSCode and PlatformIO could probably fix up the files to get it to work. But for just making some quick changes it is easier to just compile it in the Arduino IDE.

I checked and 2.0.0.144.5 and 6 are tagged and you should be able to find them the way @McLeach said. But here are links to them directly:

Another trick I learned to get the exact code for a firmware you already have is to look at the filename for the firmware. There will be a string of hex digits at the end of the filename. Take for example:
Marlin_TAZWorkhorse_Universal_2.0.9.0.13_80a6628.hex
The “80a6628” is the Gitlab commit hash. You can click the history button and look down the right side for that hash and then click the folder icon beside it to see the files. This is useful to find source code for firmware versions that weren’t tagged in Gitlab.

It’s a little unclear how to build a custom marlin for a specific model and toolhead. So, I found here what appear to be the specific parameters for printers and tool heads:

https://devel.lulzbot.com/software/Marlin/2.0.0.174/

What is unclear is what do I do with the “config” files in this dir? Do I append the contents to the confguration_adh.h file and then build?

The firmware there is unlikely to compile successfully with the dependencies of Marlin that’s been updated. Use the firmware directly on Gitlab. LulzBot 3D / Marlin · GitLab

In the marlin/configuration.h file, right at the top you’ll find the defines for model and toolhead. Just uncomment (remove the //) for what you’re building for. For example, this would build for a Taz 6 with the universal firmware, which covers pretty much every single extruder made right now (minus the new Meteor toolhead).

//#define LULZBOT_Hibiscus_Mini2
#define LULZBOT_Oliveoil_TAZ6
//#define LULZBOT_Redgum_TAZWorkhorse
//#define LULZBOT_Quiver_TAZPro
//#define LULZBOT_Gladiator_TAZProXT
//#define LULZBOT_Sidekick_289
//#define LULZBOT_Sidekick_747
//#define LULZBOT_KangarooPaw_Experimental

//#define TazDualZ
//#define LULZBOT_FILAMENT_RUNOUT
/************** Uncomment a Tool Head Option From Below *********************/
#define LULZBOT_UNIVERSAL_TOOLHEAD
//#define LULZBOT_GALAXY_SERIES
//#define TOOLHEAD_SL_SE_HE
//#define TOOLHEAD_HS_HSPLUS
//#define TOOLHEAD_H175
//#define TOOLHEAD_M175
//#define TOOLHEAD_SK175
//#define TOOLHEAD_SK285
//#define TOOLHEAD_Quiver_DualExtruder            // TAZ Pro Dual Extruder
//#define TOOLHEAD_Albatross_Flexystruder         // TAZ Legacy Flexystruder
//#define TOOLHEAD_Finch_Aerostruder              // TAZ Legacy Titan Aerostruder v1 0.50 mm
//#define TOOLHEAD_Tilapia_SingleExtruder         // TAZ Legacy Standard Single Extruder 
//#define TOOLHEAD_Yellowfin_DualExtruderV3       // TAZ Legacy Dual Extruder
//#define TOOLHEAD_KangarooPaw_SingleExtruder     // Bio Single syringe

That’s the thing, not all tool heads are there. I don’t see FlexyStruder v2 for example.

The flexystruder is the TOOLHEAD_Albatross_Flexystruder

I don’t see any actual code beyond that though, so even though it’s in the config list, it’s apparently been dropped from official support in the newer firmware. You’ll have to dig up old firmware and manually port it over if you want it in the latest version, or support drunken octopus firmware to get the download password.

The flexydually (and the Dual v2) hasn’t been included in the code for a while. You’d have to dig through old firmware to get the settings for that one. (Or drunken octopus)