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.

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

     

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

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

Submitted by Garp99 on Tue, 05/26/2020 Permalink

Could you please clarify or indicate which files were modified for your statement...

--- Source code modified to prevent releasing the BLTouch sensor during "beep" events triggered by LCD menus

 

I've noticed Marlin 2.0.x sometimes triggers the BL Touch while printing, and Marlin has removed the BLTouch menu options while printing. So it's not possible to do a BL Touch Reset within the Tune or Configuration menus.

Never mind. I see you have all your changes using

// Customized DBP

and only on Configuration.h and Configuration_adv.h

 

One thing to note in Configuration.h, you use

#if ENABLED(BLTOUCH) //Customized DBP

    #define SERVO0_PIN 27 //Important!! Set "#define BEEPER_PIN -1" in all the SANGUINOLOLU_11.h to prevent triggering the BL Touch probe during the menu use //Customized DBP

#endif //Customized DBP

 

however I've found another solution which uses this instead (set both 0)

#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 0

#define LCD_FEEDBACK_FREQUENCY_HZ 0

 

Going to test changes...

 

Submitted by AJ Mitchell on Sat, 05/09/2020 Permalink

Hello,

Can someone Please make me a firmware.bin for a Ender3 Pro with a SKR Mini E3 V1.2 Control Board 32Bit with TFT35 E3 V3.0  and BLtouch 3.0

I originally upgraded to the Creality Silent Motherboard V1.1.5 with the BLtouch 3.0 and totally destroyed my magnetic bed do to crashes in to the bed.  I have since upgraded to the SKR Mini E3 V1.2 Control Board 32Bit with TFT35 E3 V3.0 and added the creality glass bed and I am  still having issues with this BLtouch.  I do have the Z end stop installed thinking I can do that with the new BTT motherboard.  Am I thinking wrong about this?.   I am not good with coding and I don't have Adrino or Octoprint so I need to flash from the SD card.

Any Help with this would be greatly appreciated, I have a Brand New Ender 3 with a few more hundred dollars in and a bunch of parts that are piling up and never got one print done.

Please Help.. Thank you..

Submitted by Eric on Sat, 05/09/2020 Permalink

David

 

You write that one should use "Heat and Level command from the custom menu (recommended)" in the Post Installation instructions.  I couldn't find this command, so I used Level Bed and saved settings.  Has Heat and Level been removed, and if not, would you direct me towards it?

Thanks

  

Submitted by Eric on Sat, 05/09/2020 Permalink

I have an Ender3 with v1.1.4 motherboard.  Previously, I’ve installed a boot loader and I’ve kept the firmware the latest Marlin; I now run Marlin 2.0.5.3.  I also have OctoPrint running on a Raspberry Pi 4 that I use as the primary interface to the Ender 3.  I bought the Creality BLTouch kit which includes a metal bracket for the sensor, a BlTouch v3.1, Pin 27 board, and wiring.  I will install the BLTouch and wire it per the instructions and I will install your Marlin-2.0.5.3_Ultimate firmware with avrdude.  I have five questions, as follows.

 

You have some warnings about using your firmware on the stock board, but you also suggest that it has worked for many people.  So, is it OK to use your  2.0.5.3 hex file for my firmware?  I always burn new firmware with Arduino IDE after the compile; will there by any problem with switching to avrdude with your hex file?

 

You mention the relative coordinates of the BLTouch mount to the Nozzle a few times and that the default is (-42,-5,0) and you show the M851 command to change the default.  How do I find what my setting should be given the metal bracket that came with the Creality upgrade kit?  I think in the comments to your post I have read that (-45,-6,0) is what I should use but I wanted to ask the question.

 

Once the sensor is installed and wired and firmware updated, I don’t understand the next step.  You write “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.”  The v3.1 manual on your linked site says nothing about adjusting tip height.  The manual that came with the upgrade kit has four steps where one uses the knob to adjust the Z height to get a thickness of paper and setting Z offsets to C=B+A, where A is how much you moved Z to get a thickness of paper in-between the nozzle and bed and B is a Z offset red from the machine, then you store settings.  This instruction seems at odds with your “Post Installation” section where you recommend using a credit card.  So, which instructions do I follow once I’ve updated the firmware and installed the BLTouch, yours or the ones from Creality?

 

If I do follow your “Post Installation” instructions, after setting it up with a credit card, you write “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.”  I don’t understand.  It sounds like when I start printing, it will print in the air and I have to adjust the offset quickly while filament is making spaghetti?  I don’t understand this step properly.  It reads as though the previous steps 1-4 to level the bed did not result in what I am after.

 

Sorry for the lengthy post and questions, however the information you’ve put together is excellent and I want to ensure I do this upgrade properly.

Hello Eric,

I hope I can answer all your questions.

1. No problems with the stock board. It works well. Arduino IDE uses AVRDude to burn the firmware, it's the same tool I included in the package. The hex uploader provided by Creality works well, unfortunately the settings they provided in the instructions video are wrong.

2. Use a ruler and measure the distances after you installed the probe, no need to be exact. +-1mm precision is more than enought.This exists only to prevent probing outside the bed.

3. Creality uses different sizes of hotends and nozzles in the same printer model (sourcing nightmare!). You need to make sure the height from the extended and retracted probe in comparison with the nozzle height are within the range indicated in the probe manual (there is a diagram for that). If the proble is too high you need to add some washers, if the probe is too low you need to use a longer nozzle or use another bracket. According to the feedback I got from the users, most of the brackets out there (non-creality) are higher than they should and washers are required.

4. You can use one credit card, 10 credit cards stacked, a book cover, your mobile phone or a ruler. The thickness of the tool does not matter. What is important in this step reducing the height difference between the lowest part of the bed and the highest part. If your bed has a difference higher than 2-4mm the autolevel will fail (it fails silently).

5. The best way to find the Z offset after the manual and the automatic bed level is print something... With 0 offset it will always start printing in the air, that's how it works. The Z offset setting should be something between -0.4mm and -1.6mm (always negative), lower this value on the go until the filament sticks to the bed. Once you saved this setting you will never need to do it again unless you replace your hotend or nozzle.

Daniel

 

Thanks your reply was very helpful.  But you didn't quite answer my question 4.  I repeated it below:

Once the sensor is installed and wired and firmware updated, I don’t understand the next step.  You write “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.”  The v3.1 manual on your linked site says nothing about adjusting tip height.  The manual that came with the upgrade kit has four steps where one uses the knob to adjust the Z height to get a thickness of paper and setting Z offsets to C=B+A, where A is how much you moved Z to get a thickness of paper in-between the nozzle and bed and B is a Z offset red from the machine, then you store settings.  This instruction seems at odds with your “Post Installation” section where you recommend using a credit card.  So, which instructions do I follow once I’ve updated the firmware and installed the BLTouch, yours or the ones from Creality?

 

In other words, do I need to do this A and B and C stuff for setting the Z offset, which is in the manual for Creality?  Or do I just use the "Heat and Level" command per your instructions?  I gather it is the latter, but I want to be sure.

 

Submitted by Bobby Laweson on Fri, 04/24/2020 Permalink

This is the best pre-compiled version of Marlin 2 out for the Ender 3!

One request, can you make pre-compiled, TMC 2208 BLTouch version that has SoftPWM enabled?

 

Your F/W works great, but my 5015 blower whines really, really badly. I've been told that if SoftPWM is enabled in Marlin, it will cure this problem.

 

Thanks!!!

Submitted by Kent Ballsworth on Thu, 04/23/2020 Permalink

The HEX is great! But could you please compile it so that users can calibrate their extruders by calculating the esteps? This is typically found under the "movement" menu. Esteps, Jerk, Velocity, etc. etc. It's a shame to have this awesome Marlin 2.0 firmware compiled with no ability to modify these!

 

Could you please compile it for the BLTouch to include those? Thanks so much for your helps!

Submitted by Paulo on Tue, 03/31/2020 Permalink

Olá Daniel,

Recentemente adquiri uma placa V1.1.5 para minha Ender 3. Tenho um BL Touch genérico (3D Touch) e por isso sai em busca de um firmware compatível, foi assim que cheguei ao seu site. O que está acontecendo é que quando tento executar a gravação, tanto pelo VS Code quanto pelo AVRDude simplesmente fica tudo "congelado". 

Eu já tentei de tudo: reinstalei novo bootloader tanto pelo Arduino quanto pelo Raspberry PI, tentei outras versões de Fw, tentei usando outras portas USB do meu note, tentei com outro note. Já fiz com a impressora ligada, com a impressora desligada e nada...

Será que eu matei minha placa?

Agradeço por qualquer outra dica que você possa me dar.

Obrigado,

Paulo

Olá Daniel,

Descobri que o problema está em meu notebook. As portas USB só estão servindo para carregar celulares e ler pendrives, qualquer uso além destes fica congelado. Utilizando um notebook "zerado" funcionou perfeitamente. Meu note é um guerreiro, mas já está dando sinais de cansaço.

De qualquer forma agradeço muito sua atenção e o trabalho realizado e disponibilizado por você. Gostaria de saber se você pode disponibilizar o código fonte usado para gerar o HEX do firmware compilado para TMC2208 + BLTouch.

Muito obrigado,

Submitted by Clive Galway on Tue, 03/31/2020 Permalink

Hi, I used the precompiled HEX file of this build for a while, served me well, many thanks!

However now I am tinkering with building my own versions of Marlin, but one thing that was in your build I do not know how to get back...

When adjusting Z Probe offset via LCD menu, in your version this actually moves the Z carriage up/down as you adjusted the value - I found this very useful as I would G28, then move Z axis to 0, then use the Z offset setting to tweak it such that it just gripped a piece of paper - found it to be very quick and simple. In my own builds however, altering Z probe offset does not seem to move the carriage up/down as you adjust it

Is this something you enabled? If so, can you tell me what it was?

TIA

Submitted by SiXiS on Sat, 03/28/2020 Permalink

Don't know what i'm doing wrong, as soon as i enable tmc2208_stanallone there is not enough space



Der Sketch verwendet 130518 Bytes (100%) des Programmspeicherplatzes. Das Maximum sind 130048 Bytes.text section exceeds available space in board

Globale Variablen verwenden 4751 Bytes (28%) des dynamischen Speichers, 11633 Bytes für lokale Variablen verbleiben. Das Maximum sind 16384 Bytes.



in 2.0.5 and also in 2.0.4.4 version



Please help

https://crosslink.io/marlin-2-0-memory-usage-by-feature/ has some good tips on features to enable/disable to make more space available.

I took out some features I knew wouldn't apply to my setup (eg ARC support) and finally squeezed it down so I could keep BLTouch bed levelling, the temp features, and SD card support

I compiled with an Arduino IDE on the Mac, so that worked as well.

Thanks for your efforts, Daniel, this ended 3 full days of WTF, and saved a lot of brain-ache. I just wish I'd found my way to your site sooner.

In menu I set 0.2+2.4 i my measuring and nothing. Z Probe on LCD show 2.60 but in print same value. Without change. I got meny error messages from this FW. Like temp error. Z error and another. For me its not usable. :( Do you have somebody last version with BL and TMC? 2.0.5.2 on new? Or do you have only configs to marlin?

The 2.0.1 version works with all boards with or without TMC drivers. It's pure Marlin firmware with no code modifications. If you are getting temperature errors you have a hardware problem, it's not the firmware.

I made available the 2.0.5 version, see the comments below. You will have to compile for TMC drivers but this does not take more than 5 minutes.

Regards,

Submitted by Maarten Brichart on Sat, 03/21/2020 Permalink

Hi, i flashed the firmware. Menu's and all ok. All the commands for the bed leveling sensor work. but when homing it homes X and Y perfectly but then stops and tells me home Z first. the Z axis does not move. the sensorprobe tries to tho

Here download links for the 2.0.5.1 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 status/filenames scroll. If you are looking for the maximum amount of features please check the Ultimate version.