# Compiling Marlin from Source, Integrating \*.config #defines

**URL:** <https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996>\
**Category:** Software\
**Created:** [February 15, 2021, 1:19am UTC](https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996 "2021-02-15T01:19:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cg49me](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/cg49me/32/10029_2.png) [@cg49me](https://forum.lulzbot.com/u/cg49me)\
**Post date:** [February 15, 2021, 1:19am UTC](https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996/1 "2021-02-15T01:19:33Z")

</div>

I’m on a learning journey, so forgive my ignorance…

Starting out by acknowledging that the source files for the Lulzbot fork of Marlin can be found here:

> **[Marlin · master · LulzBot 3D / Marlin](https://gitlab.com/lulzbot3d/marlin/-/tree/master/Marlin)**
>
> Marlin specific for LulzBot 3D Printers

…and also acknowledging that compiled printer-specific \*.hex files and \*.config firmware files (multiple versions) can be found here:

[http://devel.lulzbot.com/software/Marlin/](http://devel.lulzbot.com/software/Marlin/)

…how do I correctly incorporate all of the #define statements from a given firmware version \*.config file into the source code and effectively compile an identical \*.hex file? Is it simply a matter of (arduously) searching through the Configuration.h and Configuration\_adv.h (…and Configuration\_LulzBot.h? Are there others?) files for the appropriate matching #define lines and copying in the values from the \*.config file? …or is there a better/more correct way?

My end goal (near term) is to create a custom firmware version for my Taz 6 with an expanded BUFSIZE and BLOCK\_BUFFER\_SIZE to try and correct some stuttering issues I have when using Octoprint. I want to make sure I’m starting from the same “factory version” that I’m currently running (1.1.9.28; yeah I know I should be on 1.1.9.34).

Thanks!

---

<div class="post-metadata">

**Author:** ![intelinc](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@intelinc](https://forum.lulzbot.com/u/intelinc)\
**Post date:** [February 16, 2021, 8:21am UTC](https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996/2 "2021-02-16T08:21:34Z")

</div>

I don’t run lulzbot or marlin firmware (though I have compiled it for lulzbots in the past, and it is a bit of a pain), so can’t help with the compilation settings. But depending on what is causing your stuttering, buffer size alone may not fix it, as the 2560 can become constrained for other reasons.

I had stuttering/pausing issues on three printers with octoprint (running klipper), and fixed all three just by culling plugins. Octoprint has a rich plugin library, but they can sometimes come at the expense of print quality (even though the processor isn’t being pegged). I still run plug-ins, but just try to keep them to core functionality.

Also note that there is the [Arc welder plugin](https://plugins.octoprint.org/plugins/arc_welder/) which tries to address stuttering by replacing large numbers of small linear moves with a single arc move. Cool stuff!

Finally, before going through the adventure of recompiling marlin just to increase buffer size, I might try klipper. All communications with the mcu are compressed by default, as it moves Gcode processing to the pi. If you’re not running trinamic drivers, it also has a noticeable impact on printer noise (not to mention speed and quality). And config changes or hardware upgrades just require simple editing of a single config file.

---

<div class="post-metadata">

**Author:** ![mrvanes](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/mrvanes/32/103_2.png) [@mrvanes](https://forum.lulzbot.com/u/mrvanes)\
**Post date:** [February 16, 2021, 8:26am UTC](https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996/3 "2021-02-16T08:26:34Z")

</div>

+1 for Klipper, I really like it on my mini + octoprint

> [@Klipper 3D firmware replacement](https://forum.lulzbot.com/t/klipper-3d-firmware-replacement/20121):
>
> A fresh Klipper 3D topic for anyone interrested in switching from Lulzbot Marlin to Klipper and needing some assistance to complete the move At the moment of writing, there are 3 working Klipper Lulzbot configurations: (a slightly modified version of) Mini 1 2016 Taz 2017 Taz dual v3 2017 Klipper 3D needs a host to run the Klipper gcode parsing firmware (e.g. the Raspberry Pi that also runs Octoprint) and sends simple stepper/heater/fan-pin instructions to a dumbed-down printer firmware. The…

---

<div class="post-metadata">

**Author:** ![cg49me](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/cg49me/32/10029_2.png) [@cg49me](https://forum.lulzbot.com/u/cg49me)\
**Post date:** [February 16, 2021, 3:57pm UTC](https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996/4 "2021-02-16T15:57:40Z")

</div>

Thanks for the replies!

I initially thought I might be hamstringing myself with plugins as well, but even with bone “stock” OctoPi and OctoPrint, I was still experiencing stuttering/random pauses. I’ll have to give Arc Welder a look, though.

My hesitation with Klipper is that I’d still like my printer to be functional using just the SD card slot, and as I understand things, Klipper would kill that.

_edit_

I also have future ambitions of adding a BLTouch to my setup, so I thought figuring out how to incorporate a simple buffer size increase would be a good toe-dip into compiling my own firmware.

---

<div class="post-metadata">

**Author:** ![intelinc](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@intelinc](https://forum.lulzbot.com/u/intelinc)\
**Post date:** [February 16, 2021, 7:43pm UTC](https://forum.lulzbot.com/t/compiling-marlin-from-source-integrating-config-defines/22996/5 "2021-02-16T19:43:29Z")

</div>

Gotcha. I can respect not letting go of the bumper! 😉

The lulzbot firmware is built using a combination of printer model and toolhead info. They maintain one codebase, and just compile firmware against specific hardware profiles. I believe there is a shell script that takes printer/toolhead arguments and outputs the corresponding configuration files required by Marlin. You can see examples of the configs generated for various printer/toolhead combination [in this directory.](http://download.lulzbot.com/Software/Marlin/2.0.0.144/)
