Marlin 2.0 Firmware configured for Ender 3 (8-bit) + 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.


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


  • 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

    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


    Other Marlin downloads for Ender 3

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

    Post Categories


    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 ?



    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 ?



    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.



    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!



    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.


    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.



    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,
                 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




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


    I think I figured it out myself.. yes, I think you had those two backwards?  G34 would only be for use with multiple z-steppers.. also, by enabling RESTORE_LEVELING_AFTER_G28, you no longer need to add the "M420 S1" to your slicer like you reccomend.  Perhaps that's why you needed to?

    Restore Level after G28 indeed replaces the M420 S1. It's not on by default because some users print over other surfaces (like other printed objects) and enabling it automatically could cause problems with this procedure.

    What this firmware prevents is disabling the bed level, once it was enabled, after G28. Therefore you can do multiple homes without having to reload the level settings or running G29.

    I followed the instructions for building from source (though I changed the stepper driver types to TMC2208_STANDALONE for my v1.1.5 board), and the flashing process looked successful:

    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    DATA:    [===       ]  29.3% (used 4806 bytes from 16384 bytes)
    PROGRAM: [==========]  99.8% (used 129744 bytes from 130048 bytes)
    Configuring upload protocol...
    AVAILABLE: arduino
    CURRENT: upload_protocol = arduino
    Looking for upload port...
    Auto-detected: COM3
    Uploading .pio\build\sanguino_atmega1284p\firmware.hex

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude: Device signature = 0x1e9705 (probably m1284p)
    avrdude: reading input file ".pio\build\sanguino_atmega1284p\firmware.hex"
    avrdude: writing flash (129744 bytes):

    Writing | ################################################## | 100% 16.13s

    avrdude: 129744 bytes of flash written
    avrdude: verifying flash memory against .pio\build\sanguino_atmega1284p\firmware.hex:
    avrdude: load data flash data from input file .pio\build\sanguino_atmega1284p\firmware.hex:
    avrdude: input file .pio\build\sanguino_atmega1284p\firmware.hex contains 129744 bytes
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 13.28s

    avrdude: verifying ...
    avrdude: 129744 bytes of flash verified

    avrdude: safemode: Fuses OK (E:00, H:00, L:00)

    avrdude done.  Thank you.

    ============================ [SUCCESS] Took 847.70 seconds ============================

    However, I now get a blank screen on reboot, and my next attempt at flashing the board results in:

    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    DATA:    [===       ]  29.3% (used 4806 bytes from 16384 bytes)
    PROGRAM: [==========]  99.8% (used 129744 bytes from 130048 bytes)
    Configuring upload protocol...
    AVAILABLE: arduino
    CURRENT: upload_protocol = arduino
    Looking for upload port...
    Auto-detected: COM3
    Uploading .pio\build\sanguino_atmega1284p\firmware.hex
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x66
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x66

    avrdude done.  Thank you.

    *** [upload] Error 1
    ============================= [FAILED] Took 195.99 seconds =============================

    This is my first attempt at upgrading the firmware on my ender 3 pro, so please accept my apologies if I've just done something dumb

    As you say, a corrupted bootloader appears to be the problem.

    If I re-flash the bootloader, then upload the precompiled hex files, I see the Marlin splash screen followed by the familiar temps and status info. However, when I power cycle the ender 3, I get a blank screen again, and the bootloader appears to have become corrupted.

    Which bootloader hex do you use? I've been using…

    I tried flashing the precompiled hex with progisp, but while that wrote and verified the flash, I still got a blank screen

    My recommendation is use the Arduino IDE and with it's own library to burn the bootloader.

    There are several settings that need to be properly configured and Arduino IDE always gets it right.

    I also advise to reset the EEPROM as soon as you can with the M502 command. Reflashing the firmware does not reset the EEPROM.

    Same exact thing has happened to me, I'm hoping this hasn't cooked my board but it's looking that direction. Any help you can offer would be huge cause at this point I think I'm just toast.

    Submitted by John P Marsden on Wed, 01/22/2020 Permalink

    All credit will go to you for this...  I am just trying to help a bunch of people that are all having a problem compiling this...


    I have a Creality Ender 3 with a Stock 1.1.4 motherboard.  I am getting a 1.1.5 Silent motherboard.

    I will be uploading to my motherboard with a USBISP cable, and I do not have a bootloader...  They take up too much memory.


    Is is possible to assist me in compiling a HEX for the Creality Ender 3 "With" the following modification....

    If possible...  One hex for 1.1.4 and One for 1.1.5


    400x400 bed size


    Standard offsets...  Creality doesn't ask for offsets when they create...

    Don't necessarily care about a custom boot screen.  Would like the stock status screens though...

    Most of us would like the M503 available if possible.

    Otherwise let me know of anything else that may be needed for removal in order to compile

    I will try it as soon as it comes in and advise if there was any problems...

    Submitted by Frank on Sun, 01/19/2020 Permalink

    Thanks for the effort... But have you actually tried this sketch yourself? This sketch is way too big for an Ender 3....

    You also need to switch off

    • all bootscreens
    • custom status screen

    :Then it will work....


    Frank, it is compiling well and the binay file fits the memory without any problems. I am running this version for weeks on my Ender 3.

    Just to double check I recompiled on 2 different computers with Windows 10 and PlataformIO 3.0.1 with core 4.1.0. Here are the resulting sizes:

    DATA:    [===       ]  29.3% (used 4806 bytes from 16384 bytes)
    PROGRAM: [==========]  99.8% (used 129792 bytes from 130048 bytes)

    I made the compiled HEX files available you you prefer to burn the firmware directly to the board using AVRDude.

    I turned the boot screen to support the Marlin development team. No other feature was fiiting in the remaining free space.

    It is configured for the generic A4988 drivers and should work out of the box but you can change the configuration.h file to enable the specific support for the TMC drivers used in the silent motherboard.

    I am not sure the firmware will fit the memory if you enable the driver and do not switch off other settings.

    All I can say to you is a massive THANK YOU for your firmware source code, its worked wonders for my BLTouch V3.1.  I have tried about 20 YT vidz and firmware going from 1.1.8a up to present (Jan 2019) none of which worked at ALL!


    Has you can imagine I have been searching for a fix for days, and then I came across your LINK!


    WOW all I can say is thank you for allowing me to print again, only had the printer for a week and thought I would had the BLTouch withing days that DID not work as expected!


    I knew it was SW related not hardware so againa massive thank you from me!


    Kind Regards


    Submitted by Nuttom on Fri, 01/17/2020 Permalink

    Hello, the link is dead !!! (but thanks for sharing it with us !!!)