Vanilla Marlin Firmware configured for Ender 3 + BLTouch

This is the 1.1.9 version of vanilla Marlin Firmware pre-configured for Creality Ender 3 printers with the 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. If you don't have a BLTouch sensor please use this version of Marlin that supports Mesh Bed Leveling.

I made avaliable the 2.x versions of Marlin for the same board and printer but I recommend using the 1.1.9.x because it is much more stable and has more features. The 2.x versions of Marlin are too big for the board memory and several features had to be removed in order to fit the firmware.

There are three installation options available, the traditional with Arduino IDE, the new method using Visual Studio Code + PlatformIO and the third one that is uploading the compiled firmware directly to the board. I recommend the PlatformIO option for most of the users, once the software is downloaded, the firmware can be upgraded in less than 5 minutes.

This firmware was made for 8-bit boards and will not work on 32-bit boards.


  • Official Marlin firmware + bugfix with all hardware settings from Creality latest official firmware (April 2020).
  • BLTouch original/generic up to 3.x. enabled by default (BLTouch 3.x might need the 5V logic enabled from the LCD menu).
  • No need to remove any capacitors from the board.
  • Installs from the original Arduino IDE (smaller download and frequent updates from Arduino team).
  • Source code was 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 and slow probing (takes around 5 minutes to complete, 10 including the bed heating).
  • Run and toggle the bed level and BLTouch tools from LCD menus.
  • BLTouch voltage/logic settings from the LCD menu.
  • Slim menus enabled.
  • Baby steps enabled and configured for the "Magic Numbers".
  • Emergency parser enabled.
  • All changes from the original Marlin config file were marked with the comment  "//Customized DBP"


  • 8-bit boards only! This will not work with 32-bit boards.
  • 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 sensors and the YouTube videos tips are most of the times wrong
  • Bootloader installed in your board
  • Arduino IDE for installation option 1
  • Visual Studio Code for installation option 2
  • AVRDude for installation option 3 in Linux or MacOS (AVRDude for Windows is included in the package)

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.

Instructions using Arduino IDE (option 1)

  1. Install the Arduino IDE
  2. Quit any software that could try to access the printer from the USB port (Cura, Serial Monitor, OctoPrint, etc...).
  3. Run the Arduino IDE and configure to download the Sanguino board. Add the following URL to the board manager (File->Preferences->Additional boards manager):


  4. Install the following libraries/boards in the Arduino IDE:
    • U8Glib
    • Sanguino
  5. With all requirements in place unpack this entire Marlin distribution to a folder and open the "Marlin.ino" file from the Arduino IDE.
  6. Look for the configuration.h file and change the following lines to the relative coordinates of your BLTouch mount to the Nozzle. The actual settings are for this mount. If you don't have the measurements now you can configure it later with the M851 GCode (see instructions below).

  7. Disable the endstop interrupts feature by commenting (//) the following line in configuration.h. This feature needs to be disabled only if you are using Arduino IDE, with PlatformIO this problem does not exist.



  8. Compile and upload the firmware. Make sure you are using the following settings.
    • Board configuration: ATMega 1284P 16Mhz
    • Programmer configuration: AVRISP MKII
    • COM Port: Depends of your computer. Usually only one is available for selection.
  9. Follow the post-installation instructions below.

Instructions using Visual Studio Code + PlatformIO (option 2)

  1. Download and install Visual Studio Code.
  2. From Visual Studio Code extension menu, install the PlatformIO IDE extension.
  3. With all requirements running, unpack the 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:
  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.

Installing the pre-compiled HEX (option 3)

The pre-compiled firmware is also available here. You can simply burn the compiled HEX file directly to your Ender3 board without installing the Arduino IDE or Visual Studio Code.

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

Finally, follow the post-installation instructions below.

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 (Prepare -> 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 -> Prepare -> Bed Leveling -> Z Offset). Don't forget to save the settings after the print to keep the offset in the memory, you can use the LCD or the M500 GCode for this.

Troubleshooting tips

  • No serial COM port appears when connecting to the board: Download the FTDI Drivers
  • Bed level failing:
    • 1st - make sure you manually leveled the bed, the probing tends to fail if any part of the bed is >2mm lower or higher than the home level.
    • 2nd - make sure you have the M420 S1 command AFTER the G28 line in your print initialization GCode.
    • 3rd - make sure your probe was installed properly, there are maximum and minimum height clearences between the BLTouch tip and the nozzle tip and that changes for each version of BLTouch.
    • 4th - check the wiring! Sometimes the wires are inverted in the default connector setup.
    • 5th - if you are using BLTouch 3.x see the next topic.
  • BLTouch 3.x failing to probe: Be aware that this is rare contition, the vast majority of the users run BLTouch 3.x without problems. I suspect this is related with the hardware (probe/board components, etc) and there is little we can do from the firmware side:
    • 1st - Enable the 5V logic in the LCD menu (LCD -> Control-> BLTouch). BLTouch versions 1.x and 2.x don't have voltage modulation do not require this setting.
    • 2nd - If the previous does not work, enable SW mode (LCD -> Control-> BLTouch).
    • 3rd - Enable and adjust the delay setting in configuration_adv.h (requires recompiling the source). This is trial an error but try values from 300 to 700 increasing/decreasing by 100.
    • 4th - If the BLTouch is version 3.0 (not 3.1, 3.x...) enable BLTOUCH_FORCE_MODE_SET setting in the configuration_adv.h.
    • 5th - If none of the above work you either have a faulty probe or a problem with the capacitor in the board.
#define BLTOUCH_DELAY 500
  • Error "..._PIN is not interrupt-capable..." in Arduino IDE: This is an Arduino IDE bug, disable the feature in the configuration.h file according to the example below to fix (put "//"). If you are using PlaformIO you should leave this option enabled.
  • 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 (PROGISP, for example) 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.
  • 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

If you have problems compiling the firmware...

I can compile the firmware for you. Please see here for more details.

Other Marlin downloads for Ender 3

Version Bugfix + BLTouch for Ender 3 (Aug 3rd, 2020)
Arduino IDE or PlatformIO
File size
4.2 MB
File 1 SHA256: 1DCD5D998C999C80D72A4153BDF27D3A2682FA5F6E869029EEB282FEE2842739
File 2 SHA256: C69961C0E223D1189FFBC2258DD30D49557BE986C5505011ABBFD479CCE61169
File 3 SHA256: D3CEFC5D5EB7C6536EFDBCED861201DA5E59272FFB0193549E2B469740452F44

Post Categories


First of all thank you for all your work on this configuration of marlin and for making it freely available. I was double checking the firmware and noticed that you have EEPROM_CHITCHAT disabled. I know why you disabled it. With EEPROM_CHITCHAT enabled the file is to large for the 8-bit board, but does disabling this not prevent services like octoprint from receiving feed back from the printer? If I have to enable this to get octoprint to work what would you recommend I disable to get the compiled file size down? Thank you again this is my first time configuring marlin for my 3d printer. I learned a lot by going through your guide.

Submitted by Florian on Sat, 12/19/2020 Permalink

Dear All,


Thanks for this great tutorial.


I have a strange behavior when starting the printing. Bed leveling is ok but at the beginning of the printing, the bed goes to max X and Max Y, extruder extrude without stoping till the plate reach max X and max Y and after it stops.  Any idea of the reason why ? 


Thanks for your help,


Submitted by Theo on Mon, 12/14/2020 Permalink

I flashed the firmware directly to my printer using an isp burner and it works pretty good, only problem is that when i level the bed it levels at 25 different points (5x5)... the bad thing about that is that it also goes out of my bed's borders so i have to put my finger over there so that the nozzle wont crash on the bed.

Any easy way to fix it?

Submitted by Michael on Mon, 12/14/2020 Permalink

If I use your firmware build, do I still need a G29 in Cura, or would that cause it to do a small 9 point auto level?

Submitted by Antonis on Fri, 12/04/2020 Permalink

Replace the default offset values in the command (-42, -5, 0) with the ones for your probe mount.


How do we get the values for our probe mount?

The command have i so.

for me it works fine with the HEX file. But I would like to use the source code because I can then (de) change the language there. Unfortunately I get an error while compiling. Line 161 "static_assert (digitalPinToPCICR (Z_MIN_PIN)! = NULL," Z_MIN_PIN is not interrupt-capable ");" is quoted with non: constant conditional for static assertion ". I don't know what to do next and hope for help here.

Greetings Winfried

Postscript: I have the 1.1.4 board


Sorry my englis is not so good.

Thanks for the answer and help

Unfortunately, my English is no longer good (I finished school for 55 years and haven't had to speak English for 5 years). That was exactly my mistake, that I didn't have a "// # define ENDSTOP_INTERRUPTS_FEATURE". Compiling worked, but I can't upload the sketch because I've switched to de language. As a result, I now have 130706 bytes. That is too much because the max. 130048 bytes of program memory. Where can I save a few bytes or can I edit the language file? Winfried

Submitted by Dennis on Tue, 11/17/2020 Permalink

Hey Daniel, thanks for making a stellar guide for updating firmware!

I flashed the version for TMC drivers, and it worked fine. I leveled my bed, which is insanely level now (largest deviation is around 0.16mm according to mesh). Probed it to generate mesh and saved the mesh. Added M420 S1 after G28 in gcode, and went on my happy way until i noticed the mesh is not being used when printing. I tried to print some leveling files, touched the z driver and it's not moving to compensate. Got any ideas how i can solve this?

Submitted by Dennis on Thu, 11/19/2020 Permalink In reply to by Pablo

Hey, i altered my starting gcode to say:

G28 ;Home all axis

M420 S1 ; reload bed mesh


I am considering if i should put a G29 A after M420 to ensure bed leveling is activated, though i've come across this post: Which mentions that he's having trouble with Bilinear and changing to UBL solved the issue of the compensation not being used.


Submitted by Gregg Lachterman on Tue, 11/10/2020 Permalink

First, I thank you for the earlier assistance. I did get compiled and uploaded.

I have a new question.

As I mentioned in earlier email I am quite new to all of this. I went to perform the bed leveling routine but get a message that probe failed.

I am using the original bracket from the bltouch upgrade kit for creality printers

Are you familiar with the bracket that comes shipped in a combo kit? Are you able to give me guidance where I might change the settings for bltouch? (3.1)





Submitted by Juan Pablo Rodriguez on Mon, 10/05/2020 Permalink

I have a problem with language switching, compilation failed due to size

"Sketch uses 130370 bytes (100%) of the program's storage space. The maximum is 130048 bytes.
Global variables use 6674 bytes (40%) of dynamic memory, leaving 9710 bytes for local variables. The maximum is 16384 bytes. "

but if you keep the language in "en" the compilation is successful, just change the language to "es" (Spanish)

#define LCD_LANGUAGE en
Result = "The Sketch uses 129872 bytes (99%) of the program storage space. The maximum is 130048 bytes.
Global variables use 6644 bytes (40%) of dynamic memory, leaving 9740 bytes for local variables. The maximum is 16384 bytes. "

#define LCD_LANGUAGE en
Result = "Sketch uses 130370 bytes (100%) of the program's storage space. The maximum is 130048 bytes.
Global variables use 6674 bytes (40%) of dynamic memory, leaving 9710 bytes for local variables. The maximum is 16384 bytes. "

I have creality 1.1.5 board and use arduino ide to load firmware.

thanks any suggest.

Submitted by Juan Pablo Rodriguez on Mon, 10/05/2020 Permalink

I have a problem with language switching, compilation failed due to size

"Sketch uses 130370 bytes (100%) of the program's storage space. The maximum is 130048 bytes.
Global variables use 6674 bytes (40%) of dynamic memory, leaving 9710 bytes for local variables. The maximum is 16384 bytes. "

but if you keep the language in "en" the compilation is successful, just change the language to "es" (Spanish)

#define LCD_LANGUAGE en
Result = "The Sketch uses 129872 bytes (99%) of the program storage space. The maximum is 130048 bytes.
Global variables use 6644 bytes (40%) of dynamic memory, leaving 9740 bytes for local variables. The maximum is 16384 bytes. "

#define LCD_LANGUAGE en
Result = "Sketch uses 130370 bytes (100%) of the program's storage space. The maximum is 130048 bytes.
Global variables use 6674 bytes (40%) of dynamic memory, leaving 9710 bytes for local variables. The maximum is 16384 bytes. "

I have creality 1.1.5 board and use arduino ide to load firmware.

thanks any suggest.

Everything went well but when I auto home  the x motor goes all the way to the left and won't stop it sits there and grinds and I have to shut the machine off.  Ender 3 pro with BlTouch.

Submitted by Felipe Drechsler on Tue, 08/25/2020 Permalink

Olá Daniel, quero te agradecer muito por compartilhar seus firmware. Agora é só só eu me acostumar as modificações da 1.1.6 para 1.1.9. Obrigado!


Submitted by Niamh on Fri, 08/21/2020 Permalink

Flashed a bootloader to a 1.1.4 board and everything works fine.

Brought a spare stock 1.1.5 board over to the house to connect directly to the PC, I could repeatedly flash different firmware to the board using Arduino.

Did PlatformIO:Build in VSCode and the firmware flashed, but it is now no longer possible to flash firmware and both VSCode and Arduino report not in sync errors.

So it definitely seems that firmware built with VSCode kills the bootloader supplied on 1.1.5 boards but firmware built with Arduino does not.

This is definitely not an Octoprint issue.

Submitted by Antonio on Fri, 08/14/2020 Permalink

Thank you Daniel for your great work and for the firmware.
I had the problem that on taller objects in conjunction with the Silent Board for Ender (Pro), the extruder stopped working about halfway through the print and the printer had printed "in the air without filament". At first I suspected "linear advance", but Daniel wrote, that it is not activated in the firmware.
I've now figured out what the problem was. The SilentBoard is relatively poorly designed in terms of thermal properties. I switched the fan on the mainboard to continuous operation, but when the extruder moves too much, the motor switches off permanently. On the one hand, this is due to the fact that the filament is damaged by the many back and forth movements and no longer fits through the extruder without force and also because the power driver of the extruder motor then becomes very hot. Here are my parameters for Cura, which ensure that the filament is withdrawn less often:
    Enable retraction: Yes
    Retraction Distance: 5mm
    Retraction speed: 50 mm / s
    Retraction Extra Prime Amount: 0
    Maximum retraction count: 10 (originally 1000)
    Minimum Extrusion Distance Window: same as Retraction Distance
    Limit Support Retractions: Yes
    Combing Mode: Yes, Within Infill

Submitted by Niamh on Thu, 08/13/2020 Permalink

Anyone seen the bootloader suddenly fail to work?

I happily uploaded firmware this afternoon having changed the Preheat ABS to Preheat PETg which worked fine, but a short while later after changing CUSTOM_MACHINE_NAME and Building that firmware wouldn't upload with-

Avrdude says: 'not in sync: resp=0x65
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x63
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x68
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6f
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x3a
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x53
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x44
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x69
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x6e

Submitted by Niamh on Thu, 08/13/2020 Permalink

Our printers are in an outbuilding so it would be easier if we could use Octoprint to upload firmware rather than having to go over with a laptop to upload  with VS Code.

Would this be the compiled firmware we need to point Octoprint at to upload?


C:\Users\Niamh Holding\OneDrive - HOLTAIN LTD\3D Print\Firmware\Source\Marlin- board-BLTouch\.pioenvs\melzi\firmware.hex

Submitted by Antonio on Wed, 08/12/2020 Permalink

I have updated my Ender pro with silent board and flashed your corresponding hex file

All seamed to work well, but now every print is failing, when the model isn’t flat enough, because extruder motor is giving up to work in mid of printing. Printing continues “in the air”, without filament coming out. It is impossible to move the motor from lcd menu, when this effect happens. The printer has to be restarted and cooled down.
I have seen, that there is a bug in marlin with the linear advance feature, which is stopping extruder when using TMC2200 steppers, see here:

Is it possible to disable the “linear advance” without recompiling the firmware?

Submitted by Lakindu Amendra on Tue, 08/04/2020 Permalink

Is resume print (after power failure) working for ender 3 pro? Im going to put this firmware on my ender 3 pro. (Not ender 3)

Submitted by Niamh on Sat, 08/01/2020 Permalink

Build is not listed under "Run Task" so I tried PlatformIO:Build (sanguino_atmega1284p) but I got-

The terminal process "C:\Users\Niamh Holding\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'sanguino_atmega1284p'" terminated with exit code: 1.


Could this be the cause of the problem?

LibraryManager: Installing id=6158 @ 1.1.2
===================================================== [FAILED] Took 3.10 seconds =====================================================