Greenonline and I spent this evening hacking/reverse engineering the Ender3 to solve this. Greenonline also wrote about this in his blog.
Step 1 - Get the Firmware
To do this, there are basically two ways:
- Find the a ready-to-use firmware
- Make your own
Variant 1 would be to use the pre-supplied .hex files from Creality or some other manufacturer. Variant 2 means writing the settings yourself or using Repetier firmware to write the files for you. In the case of the Ender 3, the chip used sadly disqualified Repetier firmware, so writing it yourself is the only option.
To write the firmware yourself or using Repetier firmware, you need the old settings. To get these, connect the printer via USB, connect it with a software like Repetier host and send
M503 to get all the settings.
Now, either hack those into Repetier firmware or use a blank
Marlin.ino and the Arduino IDE to customise it. In the later case, you need to put the folder
Marlin-?.?.X.ZIP/Marlin-?.?.X/Marlin into the
Arduino folder in Documents (Windows) or Home (Mac). Now open the
Marlin.ino in Arduino IDE. Set up the new firmware with these base settings or adjust as needed.
Step 2 - Adjust
Now that we have our Configuration files (in the end we pretty much skipped step 1 and grabbed a fitting (German!) one from Christian, a German maker also known as "Chaos-Drucker"), we need to first adjust them as needed to fit our needs and then compile them properly (next step!). As an alternative (English!) base to work with, the TH3D firmware is also available, provided by the Hooglands and team at TH3D.
So, let's open your
Marlin.ino with arduino and find the
X_MIN_POS > Search all sketches).
In the configurations we grabbed the sketch file
Configuration.h contains lines 786-789 (might differ):
// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS -10
#define Y_MIN_POS -15
#define Z_MIN_POS 0
Adjust these till the wanted position is achieved - Repetier Host can help here to determine the right position.
Step 3 - Compile
The hardest step with the Ender3 was to get the code to actually compile, as it uses an ATmega1284P 16Bit which isn't supported by Arduino natively. While the MightyCore supports this chip, it doesn't compile with this hardware library. However, Christian did figure out that the Sanguino set to an ATmega 1284P 16bit does work. These belong as extracted folders into the
Arduino/hardware folder, usually in your Documents (if you use Windows) or Home (on mac). Now, we did set
Tools>Board:> Sanguino and
Tools>Processor:>ATmega1284 or ATmega1284P (16 MHz)
It was also mandatory to have the U8glib.h for Arduino installed. To do this, download the zip from github, then in the Arduino software
Sketch>Include Library>Add .ZIP Library... and choose the whole zip repository to auto install.
With these settings we were able to compile the settings.
Step 4 - Getting it on the machine
Most people would expect to read about bootloaders and flashing now, and indeed that is an option. But as I had just figured out how to install firmware from .hex and so I wondered: Can't we make .hex files from our settings? And yes, Arduino supports this.
So, in Arduino IDE press
Sketch > Export Compiled Binary). This will result in two files:
Of these two, the
Marlin.ino.sanguino.hex is the interesting one for "direct flashing" via CURA. Use this file with the process starting at Step 2 here or use one of Greenonline's solutions to get the firmware flashed - no bootloader needed!