This is the vanilla version of Marlin Firmware 2.x pre-configured for Creality Ender 3 printers with original or generic BL Touch sensors. The standard configuration file from Marlin distribution was carefully reviewed to include the latest Ender 3 specific settings from the official Creality firmware and from Antclabs.
Please note that this is not the version I recommend for 8-bit boards like the one used in the Ender 3. The most stable and feature rich version of the firmware for this architecture is the 1.1.9 that I made available in another article. Marlin 2.x is aimed to a new generation of boards using 32-bit processors, the built in libraries are bigger and there is less space left for features. Anyway, if you want to try this you can be sure I did the best I could to configure it properly and fit the maximum amount of features possible. It was downloaded and installed more than 10000 times and I believe most of the users will find no problems with it.
Features
- Official "vanilla "Marlin firmware with all hardware settings from Creality latest official firmware.
- The maximum amount of Marlin features that I was able to fit in the small 128KB memory.
- BLTouch original/generic versions enabled by default. Compatible with BLTouch versions from 1.0 up to 3.x
- No need to remove any capacitors from the board
- Installs from the PlatformIO IDE that runs in several operating systems
- Source code modified to prevent releasing the BLTouch sensor during "beep" events triggered by LCD menus
- Thermal runway protection enabled
- Does not reset the bed level settings after the G28 (Home) command
- Custom menu with maintenance mode, emergency mode and full auto bed leveling sequence (warmup, wait, home, level and then save settings)
- Ultra-precise bilinerar bed leveling algorithm with 25 probing points, 3 slow probes per point (takes about 10 minutes to complete)
- Run and toggle the bed level and BLTouch tools from LCD menus
- Tuned PIDs for faster heating
- M503 enabled (reports all printer settings)
- Baby steps enabled and configured for the stepper driver "Magic Numbers"
- Fully compatible with OctoPrint
- All changes from the original Marlin config file were marked with the comment tag "Customized DBP"
- Due memory size limitations, the power resume function was disabled as well as the arc support
- LCD menus were changed to "slim mode" to save memory space
- Optional compiled files ready to upload to the board (no configuration, no compilation, no installation of any tools):
- Creality standard board
- Creality upgraded boards with TMC silent drivers (like the 1.1.5)
Note about the bed leveling strategy
There are two ways to perform the automatic bed leveling, the first is before every print and the second is only when necessary. Based on my experience with the Ender 3, it's better to do an extremely precise (slower) bed leveling when necessary than a simpler one before every print. This firmware configuration reflects this choice.
If you want to do quick/imprecise bed leveling before every print you will need to reconfigure the firmware.
Requirements
- BLTouch installed on pin 27
- Z stop switch removed (it can block the Z axis movement)
- IMPORTANT! BLTouch tip height must be adjusted according to the official instruction manuals. There are different BLTouch sensor clearences and the YouTube videos tips are wrong most of the times
- Bootloader installed
- Microsoft Visual Studio Code if you plan to install from the source code
- PlatformIO IDE extension installed on Visual Code if you plan to install from the source code
Instructions for installation from the Source Code
- Download and install Visual Studio Code.
- From Visual Studio Code extension menu, install the PlatformIO IDE.
- With all requirements running, unpack this entire Marlin source code downloaded from the link below to a folder.
- From Visual Studio Code select File->Open folder and select the folder where the platformio.ini file is located. Attention! Use the "open folder" command, not the"open file".
- Look for the configuration.h inside the "Marlin" sub-folder and edit the following configuration to the relative coordinates of your BLTouch mount to the Nozzle. This does not need to be too precise, the only purpose is avoiding the probe to test outside the bed. The default settings X = -42mm, Y= -5mm and Z=0 are for this mount:
#define NOZZLE_TO_PROBE_OFFSET { -42, -5, 0 }
- Save the file and then select Terminal->Run Task->Build . It will take a few minutes for the system to download all dependencies and compile the code.
- If the code compiled properly you will see something like this in the terminal: "=== 1 succeeded in 00:00:30.050 ===".
- Connect your printer to the computer using the USB cable.
- Go to the Visual Code menu Terminal->Run Task->Upload .
- If everything goes well another message like this "=== 1 succeeded in 00:00:55.010 ===" will be printed.
Installation using the pre-compiled HEX file
The pre-compiled firmware is also available here. You can simply burn the compiled HEX file directly to your Ender3 board without installing the Visual Studio Code or PlataformIO.
To upload the pre-compiled firmware you will need the AVRDUDE 6.3 tool. For your convenience I included the Windows version of this tool in the zip file that contains the HEX firmware but the tool is also shipped with the Arduino IDE and PlatformIO. The upload command in Windows PowerShell should look like this:
./avrdude -p atmega1284p -c arduino -P COM3 -b 115200 -v -U flash:w:firmware.hex:i
The serial port is something between COM1 and COM8, depending on where the USB driver is pointing to, and firmware.hex is the file you are uploading. If you are using other operating system like Linux the port address will be somehting like this /dev/ttyUSB0.
After initializing the board with the new firmware don't forget to reconfigure the probe offsets running the following command from any serial terminal. Replace the default offset values in the command (-42, -5, 0) with the ones for your probe mount.
M851 X-42 Y-5 Z0
M500
Post-installation configuration
- Manually pre-level the bed! This is important because the BLTouch has limited max/min detection ranges and the print quality can be affected if the Z-Axis moves too much.
- Cool down the bed and the nozzle. Heating should have little to no effect on this specific procedure.
- Disable stepper motors using the LCD menu command.
- Place a credit card on one the bed, the thickness of the card will be used as a reference distance.
- Turn the Z axis with your hand until the nozzle hits the credit card.
- Move hot end to several positions of the bed, starting from the 4 corners. For each position, adjust the bed level knobs to keep the nozzle at the credit card thickness distance from the nozzle. This is what you would do in manual calibration but instead of using a paper you will use the card for convenience. The card thickness does not matter because the BLTouch probe will redefine the Z reference.
- Heat the bed to the printing temperature and run the bed level command from the LCD (Motion -> Bed Leveling -> Level bed) or using the G29 gcode or using the Heat and Level command from the custom menu (recommended). Note that the Heat and Level command waits 2 minutes after the bed is hot to allow the mounted surfaces to expand/contract properly.
- Save the settings using the LCD menu or the M500 gcode (if you used the Heat and Level custom command, they will be automatically saved).
- Add the following gcode to the startup code of you slicer, right after the line of the G28 command to load the bed level configuration from the memory before every print:
M420 S1
- After enabling the bed level, print something large and flat to adjust the Z offset. The nozzle will always be far from the bed until you adjust the offset to a negative value (LCD -> Configuration -> Probe Z Offset). Don't forget to save the settings after the print to keep the offset in the memory.
Custom pre-compiled firmware versions for different BLTouch mounting brackets
If you have a different bracket for BLTouch and would like me to pre-compile the firmware for you please let me know in the comments below. The compiled firmware will be available for everyone so I need detailed information about the bracket manufacturer/model or the link to the site hosting the STL files.
Troubleshooting tips
- Disable serial port clients before flashing: If the COM ports are used by any other app, the flashing process will fail. Shutdown Cura, OctoPrint, any other slicer and any other Serial Monitor program like the Arduino IDE before compiling/flahsing the new ROM.
- Correct fuse settings: If you are using other software than AVRDUDE to upload the firmware make sure you are using the correct fuse settings. Apparently the Creality tutorial has the wrong settings and the board fails to boot afterwards.
- Reset the EEPROM: Sometimes the EEPROM memory is not reset during the Marlin reflash and this can cause problems. To reset manually use the following G-Codes from any Serial Terminal: M502 followed by M500.
- Blank screen after flashing: You did not flashed the firmware properly. Please use AVRDude according to the instructions above and if this does not work you might have to reflash the bootloader.
- Optiboot bootloader: To compile/flash the firmware forcing optiboot support, edit the file platformio.ini and replace the lines default_envs = melzi or default_envs = sanguino_atmega1284p with default_envs = melzi_optiboot . If you flashed your bootloader with Arduino IDE, that uses optiboot by default, you don't need to update this setting, it works perfectly out of the box.
- Serial Port Monitor for Windows: This small program allows you to send/receive GCode to the printer. If the characters look strange you are probably using the wrong baud rate (start with 115200bps).
- avrdude: stk500_getsync() attempt 1 of 10: not in sync: Wrong baud rate for the serial port or serial port already in use (OctoPrint, Cura, etc..). Try configuring the upload rate to 115200bps. If you are using PlatformIO to upload, make sure you are using the correct baud rate for your environment in the platformio.ini file.
- Reconfigure the BLTouch probe offsets: Use the following command replacing the -42, -5 and 0mm coordinates with the offsets of your actual mount:
M851 X-42 Y-5 Z0 M500
If you have problems compiling the firmware...
I can compile the firmware for you. Please see here for more details.
Comments
Are you compiling the…
Are you compiling the firmware? Just change a few lines to enable the TMC2208.
Thanks for all the hard work!
Hi!
Fist of all, thank you for all the work you have put into this.
I just flashed Marlin 2.0.5.1 Compiled HEX for Ender 3 + BLTouch coming from 2.0.1.
And I noticed that the heat and level bed option is gone.
Do I need to run G28 followed by G29 and finally M500 now instead?
trying to enable tmc2208 but…
trying to enable tmc2208 but not enough space, is ther something i can disable?
For the Ender 3 you should…
For the Ender 3 you should use the TMC2208 STANDALONE driver. It uses less memory.
in the configuration.h i…
in the configuration.h i defined TMC2208_standalone, but there are about 450 bytes not enough
all other parameters are left as they are
Thanks. Is it possible to…
Thanks. Is it possible to made auto bed leveling in menu?
I have question. I have TMC…
I have question. I have TMC board+BL touch. After flash to 2.0.5.1 I go to menu and use Auto Home. After this I go to Move Z and set 0. Now I go to Menu/Configuration/Z Probe and adjust end. Store setting. After print my printer always have 0.2 and print in air not to bed. What I do bad?
I will need more information…
I will need more information to knwo what's happening...
Do not print anything between the steps 1 and 8.
Regards,
Marlin 2.0.1 TMC2208
Hi,
You put different HEX for standard and silent board.
So I imagine the source code is different and i would like to know if it's possible to have a link to download source code marlin 2.0.1 for ender 3 TMC2208 + bl touch (i have an ender 3 with silentboard creality 1.1.5 + bl touch 3.1 official)
Thx
Source code is the same for…
Source code is the same for both files. To enable TMC drivers edit configuration.h and replace the driver type from A4988 to TMC2208_STANDALONE as follows:
Marlin 2.0.4.4 (March 2020)
Here download links for the 2.0.4.4 version of Marlin
Please note that due memory limitations it has less features than the 2.0.1: custom menus, boot screens, status screen and file name scroll are gone. If you are looking for the maximum amount of features please check the Ultimate version.
Amazing changes
Hi,
I want to thank you for the amazing changes you have maked. I've compared the files with the newest version of Marlin en changed them in the new version. Probing takes forever but it works so much better than everytime when you start a print and is super precise. I created a version for an Ender 3 and a Tronxy X1. I want to thank you.
Thank you
Thank you for the time and work you put into pulling this all together.
Marlin Hex bltouch TMC2208
First of all thanks for compiling this marlin.
I have tried your version with the creality 1.1.5 silent board and it seems to run well.
Maybe it is me, but I think that the steppers are a bit noisier than my previous 1.1.x marlin.
I miss the option of configuring the e-steps of the axis and the extruder in the LCD menu. Could this be fixed in the marlin? right now I don't know how to compile my own marlin.
The other thing it is that when I do the bed leveling procedure the 5x5 grid is not correctly aligned all the grid is displaced to the left a few cm, leaving like 1/5 of the right bed without probing.
This version uses "slim" LCD…
This version uses "slim" LCD menus to fit in the board memory. E-steps can be set using the following code where the 99 should be replaced by you actual steps.
The alignment of the grid is related with the way Marlin 2.0 reads and uses the probe offsets. You can change it by adjusting the X offset:
hex file for other probes
Hello,
I would like to flash directly the .hex files but the probe offsets aren't correct. I have the original Bltouch 3.1 ordered on the Creality store (see picture below) the probes are : "X-45 Y-6 Z0":
Is it possible to upload the .hex file with this offsets with silent boad parameters too?
Thanks for the reply!
Configure offsets after installation
You can configure the offsets after burning the HEX to your board. This is described in the article.
Thanks for great job
It was a lifesaver at 1am, when I desperately tried to fit marlin2.0 with ABL into my Ender 3 Pro.
Btw, it seems that you posting the source with the sole purpose of changing probe XY offsets.
Note, this can be done with M851 even for your pre-compiled hex - https://reprap.org/wiki/G-code#M851_in_Marlin_2.0.0
Thank you! The M851 was new…
Thank you! The M851 was new to me and I will update the article to reflect this option.
Petsfang V2 BLtouch Offsets
just installed a BLTouch v3.1 and I'm using the Petsfang V2 mounting bracket on the left side of my Ender 3. I have tried many times to add the offsets for the probe to the firmware but no luck compiling a viable HEX file. I think this is why I'm getting so many probing failures. According to the post on Thingiverse, these are the offsets:
v2 BLTOUCH........................X......-42................Y......-5
Could you compile your HEX file to include these offsets?
The standard hex version…
The standard hex version available here is using - 42 and - 5 for the offsets.
Bed level Error
Before i begin, thank you so much for putting your time and effort on all of this.
The problem i'm having is that i flashed it perfectly and did everything right but when it finishes to level the bed, it gives me an error saying "maxtemp:bed printer halted"
I checked the sensors and all are working fine, reflashed and still doing the same. I even just leveled it with the minimal temps on the bed and its still saying that error.
Any ideas what it can be? (note this happens with the normal level bed way or the custom command way)
This error happens if the…
This error happens if the temperature of the bed reaches 125°C. Since the bed PID control is not enabled, any spike in the reading will cause the printer to halt. If the bed is always at low temperature (60°C) you might have the firmware configured for the wrong probe type, a short-circuit or EM noise.
Before doing anything, try resetting the EEPROM: M502 followed by M500. I am not sure if the firmware supports soft limits and this would definetly reset the limit to 125°C.
Bad flash...
Hi Daniel,
Turns out it was badly flashed (my mistake...), flashed it correctly with the precompiled firmware using the USBISP from creality on settings DC D6 FD and its perfect now! Thank you!
Ohh and for anyone reading this with what i have (glass bed, new springs, bltouch 3.1 and everything configured) and using Cura 4.4, make sure you set the X and Y offset on it. The print was coming very off from the center but i managed to balance it by setting X: -5 and Y -8.5, it now prints in the center.
Screen is blank when power up.
I just flashed your firmware and the only issue i have is when i power it up the screen is blank. I have to power it down and power it back up a few times before anything shows up on screen. Once I get a screen everything seems to work correctly. Appreciate your work and help in advance.
Try to reset the EEPROM. If…
Try to reset the EEPROM. If does not work I recommend reflashing the boot loader.
I had the same problem…
I had the same problem yesterday (1 on 7-10 times i have picture on screen) . It was becouse i used fuse bit setting from creality video (D6 DC FD). Problem solved using posted here fuses DC D6 FD.
I had the same problem too and i don't what us "fuse"
i flashed the frimware with visual studio code, and have the same problem and in additon i can't reflash it and it's impossible to connect with the printer with terminal for flash the eeprom.
what i can do?
thank u in advance
Z not working
First off, thanks for all your work on this.
I think I installed everything correctly. installed the bootloader from ISP, then flashed with vcode using the marlin configuration provided here, both the regular and ultimate. I can run the g28 and g29, without problem. I get some significant variances between the 9 spots checked in g29. When I go to print anything the z-axis it starts too high in the front, then catches near the middle and finally digs into the print bed about 3/4 of the way through. In my slicer, Cura, I see there are some commands that use the z-axis position, example: G1 X0.1 Y200.0 Z0.3 F1500.0 E15. I'm assuming the z-axis reference should not be there since the printer due to the auto mesh leveling. when I remove z-axis references the z-axis does not move from it's current position. no matter what it is. I've been working on this for 3 days now, I'm about to send the bltouch back and hope I can get the old way to work again. Anyone have any advice as to what I'm doing wrong or missing?
Bed level data
Hi,
The commands you see in Cura will later be adjusted be the firmware to include the proper Z offsets according to the bed level grid.
From what you described I would investigate the following possible causes:
If nothing works you probably have a faulty probe.
Thanks! I will try these…
Thanks! I will try these when I get home. I don't think I did the bed leveling first, which is probably the step that's causing my issues. all the attempts are running together so I think I'll reset everything to stock, then install marlin again. then bed level, then try g29.
g29 runs fine right now, just doesnt seem to do anything other than report the 9 variances. /shrug.
thanks!
I give up
I reflashed the board. installed new marlin. manually leveled the bed at -2.24, sent commands through the terminal. Ran g29, got reasonable values back. m500 to save them. then ran G1 X10.1 Y200.0 Z0 F1500.0 E15, which tried to print in the air above the bed. changed it to G1 X10.1 Y200.0 Z-2.24 F1500.0 E15 it tried to print but the offset is a bit too low. I tried making changes to the firmware before upload and nothing will compile. I've tried VS Code and arduino..Doesn't seem like it should be this hard but I am obviously out of my depth.
Now to figure out how to reset it all back to factory settings.....hopefully I can get this to work otherwise I have an expensive paperweight.
It's not the firmware. How…
It's not the firmware. How did you performed the step 5 of the post configuration instructions?
I ran g28 g1 z0 after g28 it…
I ran
g28
g1 z0 after g28 it put the nozzle up super high so I, thought, had to move it to 0
then leveled the 4 corners and center as if i were a manual leveling bed which is moving the bed and nozzle to the corners and middle and using a piece of paper. I did not put it so low to catch but just enough that it was close (I didnt have a credit card or anything of similar width at the time).
then when I tried to run a test print from Cura, it tried to lay down the primer line, then tried to print way off to the left side, causing the machine to lock up.
Thanks.
The left limits are defined…
The left limits are defined by the X end stop switch. If the mechanical switch is working the car can't crash.
I recommend you to double check the electronic connections.
By design the nozzle will always be distant to the bed after the calibration and you must set the Z offset from the LCD menu to a negative value to move it closer.
I think I've misunderstood…
I think I've misunderstood the zoffset from the beginning. I thought the offset was to say how far from the probe the nozzle was, and most values I've seen online are around -2. if i do it from where the nozzle stops after homing, mine would be -18 or so. isnt that odd?
even at z-20 t's still too…
even at z-20 t's still too high to level. any other ideas? is there some other setting I can change to allow for a value of more than -20, or defaul the home z location to lower other than the z offset?
If you are using Bltouch and…
If you are using Bltouch and Ender 3 the Z offset in the firmware code should always be zero.
The physical Bltouch retracted/extended height difference from the nozzle must be within the specs in the Bltouch manual. You can adjust that using washers or different brackets.
If everything is alright the Z-Offset from the LCD menu should be something between - 0.2mm to - 2mm.
Regards
Thanks for all your help! I…
Thanks for all your help! I've decided to get rid of the probe and continue to do it manually. no matter what I did the nozzle was always 2-4mm above the bed. setting the z-offset and saving, did nothing. after homing it would, again be at 2-4 above. so each time the z-offset kept getting bigger. /shrug
anyway, thanks a lot!
upload compiled firmware problem
I am using platform in VS code and have built the firmware easily enough but when I try to upload I get avidude sync errors, I think maybe the boot loader I had has been corrupted or over written somehow ?
Is there a way to export the build file as a hex so that I can upload using my boot loader interface board that came with my BL Touch ?
or could you please make me a hex using your 2.x for bl touch 3.1 with -50 -8 0 offsets and max temp of 285 ?
Thanks for any help
The recently compiled…
The recently compiled firmware can be found inside the hidden folder named .pio/build/melzi that is automatically generated inside the main project folder. If only the upload failed you will be able to find the firmware.hex file ready to be flashed.
If you compiled Marlin 2.0.1 the folder name will be .pio/build/sanguino_atmega1284p
Found it
Thank you, I found it,
is there an easy way to add a boot loader to the ender 3, reading online seems to assume that I am knowledgable about Linux, which I'm not , it would be nice to be able to flash via USB in the future, at least until I upgrade to a 32bit board ?
No way to flash the…
No way to flash the bootloader via USB but once you have it installed you can install and update the firmware using the USB port only.
installed boot loader
I used my ardinio and some googling and managed to install the boot loader (YAY) :)
Tested it using PlatformIO by editing some FW and then uploading and now all working,
Thank you for your help.
I tried to add a small menu item but it took the FW over size, do I need to just disable 1 menu item in order to add a different one or are all the sizes different ?
thanks,
Menu items
Hi,
As far as I know the custom menu items are hard coded and limited. I recommend replacing one with the other.
Regards,
"Ultimate" version available
For power users that use OctoPrint for managing the prints I released the Ultimate Marlin 2.x version. This version does not support the SD Card reader but includes several features like the S-Curve Acceleration Feature and Adaptive Step Smoothing Feature both should improve the print quality and reduce the noise.
First - let me say THANK YOU…
First - let me say THANK YOU. I've been messing with this thing forever and was about to give up!
After manually leveling and then running Heat and Level, am I crazy or can I no longer see the default menu items (like Disable Steppers, Move Axis, Auto Home...?)
I'm trying to figure out how…
I'm trying to figure out how to determine the z offset without those menus? (Ender 3, BLTouch 3.1)
Should be there
Mine are all still there after using that command,
Maybe try rebooting thee printer ?
Hopefully that's all it is :)
Yep, that fixed it. For some…
Yep, that fixed it. For some reason I couldn't see the Motion menu item.