Installing Marlin 1.1.6 on your CR-10S with mesh bed leveling

Before we start: This is for the CR-10S and not the CR-10. Don’t use this firmware or follow these instructions for the CR-10. It is a different board and uses different settings.The older CR-10 uses a MELZI board which has less memory so in order to get it to work you will have to remove a lot of options to get everything to fit.

The firmware for the CR-10S is based on Marlin which is an open source project and as such means you can modify the source code as you want. While this article will be long and involved, I will get right to the point and just give you the .hex file and you can go ahead and just install it and close out this page. This version has mesh bed leveling, baby stepping and EEPROM storage enabled.

Inside the zip is a file called instructions.pdf on how to flash your firmware.

 CR-10S Firmware Source Code and Hex Files

However, if you’re still reading this then we will go ahead and get moving. Let’s install and configure the software and give you a quick lesson on what we will be doing.

  1. You will need to download and install the Arduino IDE.
  2. Next you will need to download and install the U8glib library. and then from inside Arduino go to sketch>include library>add zip library and select the zip file. This is a library used to run the LCD display.
  3. A preference we should setup inside of Arduino is to show line numbers. This will help us guide our way through the code and I will be referring to line numbers and the variable names for version 1.1.6. If you are reading this and using a different firmware version then line numbers may have changed but most likely the variable names will be the same. Now in the Arduino software go to File>Preferences and put a check mark in the box next to Display Line Number.
  4. Finally you need to download the 1.1.6 firmware and unzip the folder. Don’t rename the folder or move the files around inside it. You can put it anywhere you like to work on it. Go into the folders till you find Marlin.ino and open that file from inside Arduino IDE. It will open the full project and put all the files into separate tabs along the top.

Now we are ready to get to work modifying things. Most of the work we will be doing will be in Configuration.h but we will be touching a few other ones. I will call those out later on. In Arduino if a line is “commented” this means that the instructions on that line are ignored. Marlin is well written and most of what we be doing is uncommenting an option or changing a value of something. To uncomment a line you just remove the two forward slashes // at the beginning of the line. To comment out a line you will just and // at the start of the line.


Line 114: #define BAUDRATE 115200

This is the speed that it communicates over USB. It could be one of the faster speeds but honestly this is enough.


There are many boards that support Marlin and this is one of them. It is based off the very popular board RAMPS.

Line 127: #define CUSTOM_MACHINE_NAME "CR-10S"

When your machine starts up this is the name that is displayed in the bottom left of the screen. It can be anything you want between the quotes, even Printer McPrintface if you like.

Line 286: #define TEMP_SENSOR_0 1

This sets the type of sensor used for measuring the hotend temperature. For the stock hotend you will use “1” and for an E3Dv6 hotend you will use “5” 

Line 291: #define TEMP_SENSOR_BED 5

This sets the bed sensor for the stock bed.

Line 325: #define HEATER_0_MAXTEMP 250

This is the limit for how hot your hotend will go. For the stock hotend you should set it for 250 and for an E3Dv6 hotend you can set it to 300.

Line 330: #define BED_MAXTEMP 120

This is the limit for how hot your bed will go. In this case we can set it to 120 but honestly you will be lucky to ever go above 80c.

Line 528: #define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 95 }

This is the amount of steps your printer has to use to move a specific distance. Things like drivers, motors, gearing, screws can change these numbers but the ones above are good for a stock CR-10S. These can be tuned later from the control screen thanks to the EEPROM settings we will be enabling later.

Line 535: #define DEFAULT_MAX_FEEDRATE          { 2500, 2500, 100, 25 }

This is the fastest the machine will move in all directions.

Line 553: #define DEFAULT_ACCELERATION          575

Acceleration is the rate of change of speed.  It is defined in mm/s^2.  Your printer slows down when changing direction and then speeds back up again in straight lines.  This line is the acceleration the printer will make suring printing moves.  575 is fairly slow, but for a printer like the CR10S with a big moving bed, it will help prevent ringing.  


This is the acceleration applied to your extruder retraction.  You want this as high as it can go before the filament starts stripping out to help prevent strining.

Line 555: #define DEFAULT_TRAVEL_ACCELERATION   1000

This is the acceleration of your printer when it is not printing.  Since it is not printing at the time, it can be a little higher since you won't be able to see the ringing.  If it is too high, you could see skipped steps and layer shifts.

Line 745: #define INVERT_X_DIR false

Line 746: #define INVERT_Y_DIR false

Line 747: #define INVERT_Z_DIR true

These 3 line define the direction of each axis. If your machine moves in the opposite direction of what you expect then change it to true or false.

Line 777: #define X_BED_SIZE 300

Line 778: #define Y_BED_SIZE 300

Line 786: #define Z_MAX_POS 400

This is where we set the actual bed size of your printer and the Z height.

Line 801: Uncomment #define FILAMENT_RUNOUT_SENSOR

This will enable the filament sensor.

Line 803: #define FIL_RUNOUT_INVERTING true

Here we are changing the way the switch on the filament sensor works.

Line 855: Uncomment #define MESH_BED_LEVELING

This is the fun part. No probe, no hardware. This allows you to level the bed at multiple points manually and it will create a 3D mesh of the surface to allow you to print on an uneven bed.  It will use the manual bed leveling as defined here

Line 874:  #define GRID_MAX_POINTS_X 3

We are setting this to 3 which means it will have you level 3 times along the X axis and 3 times along the Y axis for a total of 9 points. If you set this to 5 then it would mean you have to adjust level 25 times on the bed. 3 is a really good number for this.

Line 956: Uncomment #define LCD_BED_LEVELING

This adds the option to run mesh bed leveling to the LCD screen.

Line 964: Uncomment #define LEVEL_BED_CORNERS

This adds the option to level the corners of your bed before running mesh leveling.

Line 1018: Uncomment #define EEPROM_SETTINGS

This allows you to adjust things like offsets and steps and store them.

Line 1019: Uncomment #define DISABLE_M503

This is a command that shows the settings as they were set in the firmware and not the ones you changed in the EEPROM. We are disabling this to save some memory.

Line 1050: #define PREHEAT_1_TEMP_HOTEND 205

Line 1051: #define PREHEAT_1_TEMP_BED     60

Line 1052: #define PREHEAT_1_FAN_SPEED     0

Line 1054: #define PREHEAT_2_TEMP_HOTEND 250

Line 1055: #define PREHEAT_2_TEMP_BED     80

Line 1056: #define PREHEAT_2_FAN_SPEED     0

The lines 1050-1056 set the temps and fan speeds for the menu items to preheat for PLA and ABS.

Line 1232: Uncomment #define SDSUPPORT

This enables the SD card slot so you can print from SD.

Line 1257: Uncomment #define ENCODER_PULSES_PER_STEP 1

Leave this at 1 for the CR-10S

Line 1263: Uncomment #define ENCODER_STEPS_PER_MENU_ITEM 5

This is how far the knob needs to turn to move between menu items. Make this number lower if it is too sensitive and higher if it is not.

Line 1303: Uncomment #define SPEAKER

This will let the machine beep and make sounds.


This enables the LCD screen. When we first installed U8Glib library, it was for this option.

Line 1684: #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75  

Here we set what size filament will be used in the machine.



Line 602: Uncomment #define BABYSTEPPING

Baby stepping allows you to adjust the Z axis while printing to help get the perfect 1st layer.


This is how much your Z axis will move per rotation on the knob. I find 5 is a good number but if you want finer control then lower this number. IF you want it to move more per click then increase this number.

Line 608: Uncomment #define DOUBLECLICK_FOR_Z_BABYSTEPPING

This makes it so if you want to adjust baby stepping then you can press the control knob two times quickly and you will enter baby step mode.

Line 683: Comment out //#define ARC_SUPPORT

Not really used since most slicers don’t do this function by default. If we disable it then we save even more memory.

Line 819: Uncomment #define ADVANCED_PAUSE_FEATURE

This is for the filament runout sensor. It will home the hotend and unload the filament from the nozzle. Then once you load more filament it will wait till it’s extruding before beginning the print.


Line 206: #define FIL_RUNOUT_PIN      2

We are changing this one value from 4 to 2 so we are using the right pin for the filament sensor.


All done! Save your work.

Wow, you really have been sticking with me this whole time and you have modified everything and you are ready to build your firmware and install it. Kudos for sticking with me this whole time.

  1. Select Tools>Board>Arduino/Genuino Mega or Mega 2560 and then Tools>Processor>ATMega2560 (Mega 2560) and then select the COM port for your printer. Did I mention that you should have already plugged your printer into your computer?
  2. Now we want to verify and compile the code. You can do this by clicking on the checkmark icon in the tool bar or by going to Sketch>Verify/Compile
  3. If you got no errors then congratulations and now you are ready to upload the firmware. Go to Sketch>Upload or click on the icon in the toolbar that is an arrow pointing to the right.
  4. Now you are all set and good to go, enjoy your new firmware. Let us know what you think and if you think we should do anything more.


While you're here.

Did you know carries upgrades and materials that work great on the CR-10 series of printers.  Check out our line of authentic E3D parts here.  You can find Capricorn tubing in the same area.  Our economy line of filaments including colorFabb Economy and Hatchbox may also be of interest to you and can be found here.

David Randolph
David Randolph


I have a background in film and television engineering and IT with over 9 years with 3D printing and laser cutting. I've fought robots and even has a Guinness world record for worlds largest video game controller. My nerd cred is strong.

17 Responses


November 18, 2017

I tried the HEX files on my cr10s but the nozzle temp only goes up to 235c. so i went back to factory hex file. why is that?


November 18, 2017

Hello everyone,

can someone please help me here, as I’m not sure where and how to connect the filament runout sensor on the CR10S motherboard.

A picture with the connection diagram would also be very helpful.

Is it necessary to change the script in the slicer by using the filament runout sensor?

If yes, where???

Unfortunately I am a layman and grateful for any help here.

Thanks for your help in advance.

Best regards,

Derrick Smith
Derrick Smith

November 17, 2017

Yall saved me some time today. Thanks!!


November 14, 2017

I had to change the z step value for the leveling, as now it was going up and down in 0.1 increments which was way too much (e.g. paper stuck at 0.2 and completely loose at 0.3)


November 06, 2017

For any one upgrading the CR-10 motherboard to the CR-10S mother and keeping the original CR-10 display (single cable).

2. Uncomment line 1525 “#define CR10_STOCKDISPLAY”.

3. Then you need to carefully ,using pliers, remove plastic shroud from port exp1 and rotate it 180 degrees. The slot alignment slot should face inwards instead of outward. Simply pull gently on both sides and it will come off easily. Be careful not to grab the pins in the process.

4. Reconnect the display cable.

5. Flash your firmware
Congrats…you should now have a working CR-10S Motherboard with a working CR-10 original display. Enjoy!


November 06, 2017

Hello, very nice work !!!!
It’s possible to put a touche screen MKS TFT 3.2 ?K


November 04, 2017

@Thomas, the one with no bootloader works well.


November 04, 2017

If you want to use the SD card normally, edit “ultralcd.cpp” lines 977 and 985, it should be: #if PIN_EXISTS(SD_DETECT)
instead of #if !PIN_EXISTS(SD_DETECT).


October 31, 2017

Nice tutorial but why does the printer restart with the motherboard fan off when switching the power off and why is the initialize SD card is gone in your ready to upload firmware?


October 30, 2017

discussion of my difficulties swapping a CR10S mainboard into a regular CR10 are here: any insights much appreciated!


October 27, 2017

Thanks David, I have now changed the firmware to use //#define CR10_STOCKDISPLAY instead of //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and I’m sure that would be the right screen, but it still doesn’t work. Presumably that sets the pins correctly, so any idea if there could be something else I need to change?

Where are the fans plugged in on the CR10S? On the CR10 the always on fans are connected directly to the 12v input, but the new board has 3 headers labeled Fan1 Fan2 Fan 3 so I used those. I assumed they would be always on since there is a separate header for the controlled prat cooling fan. Do you know if there’s a firmware setting that controls those 3 fan headers? Obviously I can keep the fans on by connecting directly to the 12v as on the Melzi, but those headers must be intended for something!

David Randolph
David Randolph

October 26, 2017

Marcos Diez: The power loss feature is not in this firmware. I have not gotten my hands on the new board that supports it to figure out if it’s firmware or hardware doing it. Usually it’s a combination of both so I am waiting on new units to arrive to test.

Parenthetical: The always on fans should be just that, always on. Most likely you just got them plugged into the wrong spot when you swapped boards? As for your screen, it most likely has a different pin set than the ones now included with the “S” model. So you can mess around with the pins on the LCD_full graphics controller to try and get them to move over (I don’t have the original CR10 so I don’t have the original screen to mess with pins for testing)


October 26, 2017

I have ended up trying to install a new CR10S board in a slightly older CR10 – the flashing process as above compiles and uploads without errors and I have disabled the features I don’t have such as filament sensor. Connecting to the printer with S3D it reports correct upgraded firmware – but the printer screen doesn’t work.

The screen I have uses just a single ribbon cbale, and the old melzi board has only one screen cbale connector, but I notice that the new board has two connectors – are both connectors required to be connected? If so I will have to buy a new screen with two connectors to be compatible.

Also the fan connectors for the always on fans – I plugged them into the fan connectors next to the XYZ end stop plugs – but they don’t work either. (but the controlled speed part cooler fan does work) How are the always-on fans supposed to be plugged in on a CR10S?

Marcos Diez
Marcos Diez

October 25, 2017

Nice tutorial! Thanks! I want to install it, however it isn’t clear to me what will happen with the power loss resume feature that comes with the stock firmware… and whether the stock firmware provided in the ZIP file is the same I have in my CR-10 S3.

Reading around, some people claim Marlin doesn’t have this feature (IDK if it does in the 1.1.6 version) and it’s a manufacturer’s addition to the stock firmware, hence my question.

Thank you very much!


October 24, 2017

It may be easier to start with the files in Marlin/example_configurations/Creality/CR-10 which already has most of these settings applied. If it would help to have a CR-10S config in there as well, I would be happy to add it!

David Randolph
David Randolph

October 24, 2017

Yes you can. The one without the bootloader is the one you want.


October 24, 2017

Great Tutorial!!!

Can I export the file and upload it over the Repetier-Server?
If yes, which of the exported HEX-files is the is the right one – with or without bootloader??

Many thanks

Leave a comment

Comments will be approved before showing up.