Marlin 2.0 Firmware configured for Ender 3 + BL Touch

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

    1. Download and install Visual Studio Code.
    2. From Visual Studio Code extension menu, install the PlatformIO IDE.
    3. With all requirements running, unpack this entire Marlin source code downloaded from the link below to a folder.
    4. 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".
    5. 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 }

       

    6. 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.
    7. If the code compiled properly you will see something like this in the terminal: "=== 1 succeeded in 00:00:30.050 ===".
    8. Connect your printer to the computer using the USB cable.
    9. Go to the Visual Code menu Terminal->Run Task->Upload .
    10. 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

    1. 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.
       
      1. Cool down the bed and the nozzle. Heating should have little to no effect on this specific procedure.
      2. Disable stepper motors using the LCD menu command.
      3. Place a credit card on one the bed, the thickness of the card will be used as a reference distance.
      4. Turn the Z axis with your hand until the nozzle hits the credit card.
      5. 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.
         
    2. 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.
    3. 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).
    4. 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

       
    5. 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

       

    Other Marlin downloads for Ender 3

    Files
    Version
    Marlin 2.0.1 (January/2020)
    Platforms
    Any operating system
    File size
    5.1 MB (source), 450 KB (HEX)
    Checksum
    Package 1 SHA256: 770FA69E3F5A694C41521CBE307EA9B6CC73CCCAE7494669EF93B87D68D0DE9E
    Package 2 SHA256: E557C4E5CA17BE436BEE977DA3C864734C66516A0D5608841A6C4DBF47201509
    Package 3 SHA256: 96242782112FBE50EE206EA826FBDB38B22DB342D020E83C947109EDEC36B61A
    Screenshots

    Post Categories

    Comments

    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,

     

    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.

    Submitted by Liz on Sun, 02/02/2020 Permalink

    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...?)

    Remember that this is Marlin 2.0 and the menus are slightly different from 1.1.x. The items in the former "Prepare" menu are now distributed in the "Motion" and "Temperature" menus.

     

     

     

    Submitted by Ragpuss on Sat, 02/01/2020 Permalink

    Great Firmware , I have run the hex as is for a couple of weeks and working well.

    can you add a compiled hex for BL Touch with a V6 hotend fitted with the Hero Me double 1510 fan mount ?

    I can find the offsets etc' if you don't have them, there were a few alterations needed with the steps, temps, etc' I pretty new to 3D printing and trying to learn about the coding but not there yet.

    Also is it possible to enable the M600 function ?

    Thank you in advance.

     

    You need to measure the offsets for the BLTouch using a ruler. The extruder steps and temperatures can be adjusted from the LCD menu, no need to hardcode in the firmware.

    M600 requires Advanced Pause feature that requires Nozzle Park feature. With all that enabled the firmware does not fit the small 1284p memory. Disabling the SD card would free enough memory for both features but I belive the best option is use the slicer filament replace command.

    Thank you for your reply,

    I will work out those off sets and re-post.

    I use a Pi with Octoprint for uploading my prints so not really using the SD however is there anything else that would give the room ?

    Thanks again.

     

    No. The Ultimate version is optimized for using less processor cycles and has advanced movement smoothing features enabled.
    I recommend you to start using this version and move to the Ultimate only when you are very familiar with your printer otherwise it is very difficult to differentiate hardware/calibration problems and firmware glitches.

     

    I do have that add-on but I have found it hard to change colour part way through a print and then successfully resume, maybe me doing it wrong but that add-on also has the M600 command in place which is much easier but needed the advanced pause etc' to be enabled.

    Thank you again for your time and great work :)

     

    I just installed this and all seems well, a few things in the LCD that I need to learn about, lol

    The only thing so far that I am having a problem with is the maximum temp' I can't get it past 260 but the E3D V6 want it to be 285, can I c change that somewhere or is it a FW only setting ?

    Thanks

     

    You will have to change the temperature limits in configuration.h : #define HEATER_0_MAXTEMP 275 and recompile the firmware (takes less than 5 minutes).

    Please doublecheck if your board can handle the increment of power. Ender-3 boards are not designed for high power outputs.

    I tried running a build after some mods on this 2.03 ultimate firmware but platformio shows an error as soon as the build starts.

    The error is something about the environment name, like, "Melzi \\ custom..... "

    Have you had the same error ?

     

    The error I'm getting is in the platformio.ini file,

    the environment shows Melzi  #// Custom DB

    If I change this line to just Melzi then it works

    is it ok to do this or is that there for a reason ?

    thanks

     

    I got it to install and all seemed good until I tried the auto bed levelling when it came off of the front of the bed by about 10mm ?

    I have the offsets the same as what work with the 2.01, is there something else in this Ultimate version that needs changing or do I need different offsets for some season ?

    Thanks,

     

    Thank You,

    That worked,

    I had to add -10 to the Y offset, so even though my Y offset is -8 I had to set it to -18 , very odd, lol

    Still at least it's all working as it should, I guess I will need to test the offset with future releases ?

    Thanks again , as usual Firmware is working great. I just fitted a magnetic Steel & PEI bed plus the E3D V6 and with this FW it's printing better than ever :)

     

    Does an SKR 32bit board have a larger memory for the FW ?

    I was thinking of swapping to a BTT 32bit board and was wondering if your V2.x FW would go on in its entirety , so I could use BL Touch, runout sensor, SD Card, M600 and all the other LCD settings ?

     

    32-bit boards have 4 times the flash memory (512KB vs 128KB) and can run Marlin with virtually all features enabled. The boards are also faster and can process complex GCode without lags (lags=blobs).

    Please note that the firmware version I made available here is not compatible with 32-bit boards because the instruction sets are completely different. The burning procedures are also different.

     

    Thanks for the reply,

    It sounds like a 32bit board is the way to go then, I will have a search for your FW and see if I can work things out, I'm getting to old for learning new tricks but will try, lol.

    Thanks again,

     

    I have not yet built the V6 system up but these are the published offsets for my build.

    -50 for the X axis and -8 for the Y axis

    This is the Hero Me dual 5015 fan duct with the E3D V6 and BL Touch, mine is the BL Touch 3.1

    Thank You :)

     

    I got some requests from users to update this firmware to Marlin 2.0.2 or 2.0.3 (bugfix).

    I tried to compile both versions but due the updated libraries used in the distribution, the final binary file was too big for the small Ender 3 board. Although I can fit the newer versions of the firmware in the board memory this will force me to remove part of the functionality, typically commands available from the LCD Menu.

    After a carefull review of 2.0.2 and 2.0.3 release notes I found that none of the updates/fixes would improve or impact Ender 3 performance, therefore, trimming the firmware just to fit the newer versions in the memory would not worth.

    I will keep following the future releases of Marlin and If I see any significant improvements for the Ender 3 I will release an updated version of the firmware, otherwise I will keep the older version that is stable with hundreds of printing hours accumulated.

    Daniel

     

    Submitted by Adam Andrews on Wed, 01/29/2020 Permalink

    Hey your firmware worked and uploaded to my printer but it does 25 probing points before it prints anything.

     

    Is there something I forgot to change? cause this increases the print time by like 20 mins

     

    The firmware does not probe the bed before every print, your print initialization GCode is responsible for that. This setting is not enabled by default, It seems you enabled it by following another tutorial.

    Here is how to fix that:

    • Go to the printer configuration in your slicer and make sure there is no G29 command in the initalization GCode. If you see, erase the line.
    • In the same printer configuration add the command M420 S1 as a new line just after the G28 command line. This will load the previously saved Bed Level settings.

    You are done! Don't forget to re-slice previous models that probably came with the G29 command embed in the code.

    Submitted by Guy on Sun, 01/26/2020 Permalink

    In the Creality Youtube video the lady says to make the ConfigBit Values to D6 DC FD.  This does not work for Daniels Firmware for some reason. 

    Thanks to EightBit I followed Teaching Tech, he sets the Values to DC D6 FD.  This Worked!  Thanks everyone for the hand holding here.  What a great community!

     

    Guy

    Thank you, Guy,

    The firmware I made available here is 100% Vanilla Marlin, I did not modified the source code. The only thing I did was tweak the configuration files based on the original Creality calibration + hundred rounds of compilation, uploads and test prints.

    I will write a detailed article on how to burn the bootloaders but at the moment I'm still figuring out how the different bootloaders work for this board and the impact of the fuse settings in the final results. From what I got so far, Creality uses very old versions of libraries to build their compiled firmwares and this could be the reason why some settings don't work with recent versions of Marlin.

    Regards,

    Submitted by EightByte on Sun, 01/26/2020 Permalink

    Just a note I wanted to add. Another method of install is to follow the directions included with the BLTouch with the Chinese instructions and use this firmware instead of the firmware they provide. This allows you to use the programmer that they provide if you don't have it options. I just followed Teaching Tech's tutorial on the BLTouch kit and flagged a different firmware as he had suggested.

    Anyhow, thanks for the Marlin firmware configuration, it works 100% for me, which is a relief after trying tutorial after tutorial with no success. Keep up the great work!

    Submitted by Guy on Sat, 01/25/2020 Permalink

    Thanks for your efforts here but this doesnt work.  The I get a blank screen when flashing with your hex.  Going back to manual bl.  The BLtouch v 3.1 quite a disapointment.

     

    Guy

    If your using the programmer, make sure the pins are facing the right way, I flipped it once on accident and got the blank screen but you a reflash in the proper direction everything is working for me now!

    Submitted by Guy on Sat, 01/25/2020 Permalink

    I am using Ender 3 Pro with BLtouch 3.1.  I am trying to flash the firmware using your hex and it will not write.....

    PS C:\3d\Marlin-2.0.1_HEX> ./avrdude -p atmega1284p -c arduino -P COM3 -b 115200 -v -U flash:w:firmware.hex:i

    avrdude.exe: Version 6.3, compiled on Sep 12 2016 at 17:24:16
                 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
                 Copyright (c) 2007-2014 Joerg Wunsch

                 System wide configuration file is "C:\3d\Marlin-2.0.1_HEX\avrdude.conf"

                 Using Port                    : COM3
                 Using Programmer              : arduino
                 Overriding Baud Rate          : 115200
    avrdude.exe: stk500_getsync() attempt 1 of 10: not in sync: resp=0x65
    avrdude.exe: stk500_getsync() attempt 2 of 10: not in sync: resp=0x63
    avrdude.exe: stk500_getsync() attempt 3 of 10: not in sync: resp=0x68
    avrdude.exe: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6f
    avrdude.exe: stk500_getsync() attempt 5 of 10: not in sync: resp=0x3a
    avrdude.exe: stk500_getsync() attempt 6 of 10: not in sync: resp=0x54
    avrdude.exe: stk500_getsync() attempt 7 of 10: not in sync: resp=0x46
    avrdude.exe: stk500_getsync() attempt 8 of 10: not in sync: resp=0x20
    avrdude.exe: stk500_getsync() attempt 9 of 10: not in sync: resp=0x63
    avrdude.exe: stk500_getsync() attempt 10 of 10: not in sync: resp=0x61

    avrdude.exe done.  Thank you.

     

    Thank for all your help

    Guy

     

     

    Submitted by dragoonjefy on Sat, 01/25/2020 Permalink

    I see in your notes, you advertise:
    Does not reset the bed level settings after the G28 (Home) command.

    But looking at the source code, I see in Configuration.H that:

    //#define RESTORE_LEVELING_AFTER_G28  .... is still disabled.  I'm VERY new to this (flashing my ender for the first time tonight), but is that right?

    I "do" see in Configuration_adv.h that:

    #define RESTORE_LEVELING_AFTER_G34  ... is ENABLED, but that's something completely different, right?  G34 is like z-stepper auto-alignment??