Page 1 of 1

Adapting latest Marlin release to M2?

Posted: Sat Mar 11, 2017 10:30 pm
by nirfriedman
I need to use an option (DISTINCT_E_FACTOR) that appears in the latest stable(?) Marlin release (Marlin 1.1.0-RC8).

What do I need to change to make it compatible with the M2 printer?

I see that MakerGear recommends specific Marlin versions for each model. I am not sure if this is because there is a major adaptation needed, or these are just differences in the configurations? Comparing source code between my M2 version and the 1.10-RC8 shows massive differences (seems almost like a total rewrite).



Re: Adapting latest Marlin release to M2?

Posted: Sat Mar 11, 2017 11:14 pm
by ednisley
nirfriedman wrote:seems almost like a total rewrite
That's a fair summary of the situation. During the past year or two, Marlin has undergone a major cleanup & refactoring, to the extent that even the configuration files have different layouts & contents.

Basically, you must hunt down the new locations of the old parameters, ensure all the new-new parameters have sane default values for your hardware, then compile & test the firmware to verify it actually does what you expect (or, at least, what the old version did). After that, you can make whatever changes you deem appropriate.

There's a good reason why CNC machine tools run software on ancient Windows 95 PCs: as long as it works, you never, ever update it!

Re: Adapting latest Marlin release to M2?

Posted: Sun Mar 12, 2017 6:52 am
by nirfriedman
Thanks! Sounds like a fun weekend activity :-)

Three questions:

1. Are we talking about parameters only, or are there additional functionalities in the M2 version?

2. Things to beware while testing? (I don't want to brick my machine)

3. How stable are these newer versions, should I treat them like production code, or are they more of early beta stage?

Ah, and the obvious question, did anyone do this already?

Re: Adapting latest Marlin release to M2?

Posted: Sun Mar 12, 2017 12:33 pm
by ednisley
nirfriedman wrote:additional functionalities in the M2 version
To the best of my knowledge as an innocent bystander, each version of the M2 runs whatever was the current version of Marlin at the time. I've installed more recent versions on my early 2013 M2 as I've tweaked this-and-that, but I'm not doing anything particularly exotic.

There's no way to "brick" an M2, short of physically damaging the RAMBo, because you load the entire firmware slug every time. If a mutated version doesn't work, then you just (re)load the previous version and away you go.

I think cautions about compiling with long-obsolete versions of the Arduino IDE versions no longer apply, but cruft is hard to cut through.

As far as stability goes, if you need features in the latest & greatest release, beyond the more-or-less stable 1.0.2-2, then you get what you get:

"Release Candidate -- Marlin 1.1.0-RC8 - 6 Dec 2016 -- Not for production use – use with caution!"

Basically, I run a handful of calibration squares, bang out a planetary gear toy, and if it all works as before, I'm perfectly content.

IMO, they've spent far too much time & effort jamming way too much functionality into a 8-bit microcontroller teleported from the mid-1990s, to the detriment of stability and usability. Marlin is the last gasp of complex AVR microcontroller firmware; everything in the future will run something like Linux (maybe with real-time scheduling kernel hacks) on something like a Raspberry Pi.

Re: Adapting latest Marlin release to M2?

Posted: Fri Apr 21, 2017 1:35 pm
by nirfriedman
So, after some delays (mostly due to work load) I returned to this project. I backup the working firmware (compiled version). Working through the configure.h and configure_adv.h I tried to match the values to these in the latest M2 Marlin for my machine (Old 24V dual extruder). This required upgrading the Arduino IDE (and now the old version of my firmware does not compile).

So far I run aground even before printing. The new firmware does not turn on the extruder fan... on top of that the startup sequence I usually use did not go smoothly. I think this is due to a different treatment of the tool offsets when switching tools - didn't find configuration options related to that.

I would appreciate if someone has messed around with some of the latest versions of Marlin and has insights about the configuration.


Re: Adapting latest Marlin release to M2?

Posted: Tue Aug 01, 2017 7:58 pm
by jferguson
I've come to the firmware now. What's in my new M2E appears to be what's on the makergear wiki site. It also appears to compile 'only' with Arduino IDE 1.5.5 which the site says is BETA. I did try compiling on 1.6.5 but no joy there.

I figured out how to isolate my Ubuntu 16.04 64 bit Arduino 1.5.5Beta installation from the other one, loaded up the MakerGear firmware and it compiled!!

But not without throwing off a bunch of warnings - to wit:
/tmp/ccOI9cla.s:1273886: Warning: .stabs: description field '111ba' too big, try a different debug format
/tmp/ccOI9cla.s:1273887: Warning: .stabs: description field '111a1' too big, try a different debug format

Sketch uses 130,084 bytes (50%) of program storage space. Maximum is 258,048 bytes.
Global variables use 4,919 bytes (60%) of dynamic memory, leaving 3,273 bytes for local variables. Maximum is 8,192 bytes.

There were a whole lot more of the warnings all similar. Past experience has been that warnings do not preclude the code working, on the other hand that it compiled doesn't necessarily mean that it will work.

Has anyone seen this before. If not, I'll troubleshoot this myself.

BTW, I loaded up a roll of Esun PTEG, adopted Jules' settings and have almost completed my first print which looks very good. It has some hairs but not many and they should be easy to trim.


Re: Adapting latest Marlin release to M2?

Posted: Sat Dec 02, 2017 3:55 am
by SandiaScalpel

I just uploaded a new firmware to my M2 (early version 4/2014) that I had recently converted to a dual extruder setup. I was dismayed that I could not use my ViKi 1 LCD panel attachment with the dual extruder firmware for the M2.
I submitted a request to MakerGear for M2 24v pwer supply with old z-axis stepper motor and dual conversion (to v4 hot ends) to include some basic support for the ViKi 1 LCD panel. Low and behold! Jason, from MakerGear (the guy who writes the firmwares) was incredibly nice and seemingly modified some rev.E firmware just for my purposes!

I just uploaded the new firmware to my M2 with arduino 1.5.5 and when it compiled i had a lot of the same errors that @jferguson had noted, but it uploaded just fine.
/tmp/ccOI9cla.s:1273886: Warning: .stabs: description field '111ba' too big, try a different debug format
/tmp/ccOI9cla.s:1273887: Warning: .stabs: description field '111a1' too big, try a different debug format
the M2 started right up and the ViKi 1 LCD panel worked properly - now showing temperatures for 2 hot ends!!

I'll report back if i discover any issues.

if anyone has a setup like mine and needs me to post the modified firmware that i had received from Jason at MakerGear, just reply here or DM me.

Re: Adapting latest Marlin release to M2?

Posted: Mon Dec 04, 2017 5:41 pm
by jk42
Just want to add some clarification. Although I do modify firmware, I cannot take credit for writing it. (not that good yet)
The VIKI 1 is, technically, not supported for Dual extruder models. Josh, the actual firmware author, found that firmware for you to try.
We hope it will work well for you, however as it is not supported, we can't guarantee it.
If anyone need help with a firmware issue, please feel free to contact support! :D

Re: Adapting latest Marlin release to M2?

Posted: Wed Dec 06, 2017 4:30 am
by SandiaScalpel
First 4 prints with the dual modified older M2 and Viki support went without a hitch!

Thanks again.


Re: Adapting latest Marlin release to M2?

Posted: Sat Mar 16, 2019 3:34 am
by Baxsie
I have (somewhat) got my M2 working with the latest and greatest Marlin firmware. (Marlin-1.1.x)

All the changes I have made are preceded by the comment "//BAC"

I have tried to add notes when something is not obvious. I have a graphical LCD and SD card.

All the changes are in configuration.h and configuration_adv.h here is a zip of just those two files:

Here a zip of the whole folder, that I built from: ...

For reference, here is the unmodified Marlin zip from Github (downloaded 2019-03-14): ...

I will not make any claims about it, only that it works somewhat on my printer. Here is a Benchy made using PETG:

I do not think it would be a bad place to start for someone who is more ambitious about the port -- like MakerGear, maybe?

I have a 24v hot end, heated bed (my own PEI design), silver Z motor and min (top) Z limit.