Introduction: Flashing a Bootloader to the CR-10

Picture of Flashing a Bootloader to the CR-10

The Melzi board contained in the Creality CR-10 does not come pre-flashed with a bootloader. A bootloader is what enables us to write firmware over usb. If we plan on flashing new firmware and don't want to have to take the control box apart every time, we need to flash one.

We will be flashing this bootloader via ICSP using an Arduino as the programmer. This same task can be completed using a USB ICSP Programmer. I had an Arduino Uno lying around so that's what we'll use for this demonstration.

Note that the firmware I provided is almost totally stock. I made no real modifications. I simply provided this for others who wish to modify their firmware.

Step 1: Programming the Arduino UNO

Picture of Programming the Arduino UNO

IF YOU ARE USING AN ARDUINO MEGA OR MEGA2560 THIS WILL NOT WORK. INSTEAD, USE THE ALTERNATIVE METHOD OUTLINED IN STEP 3

First, download and install the latest version of the Ardunio IDE from Ardunio. Then connect your Ardunio via USB to your PC. Once connected we will have to determine which COM port your Arudino is using. So open up Device Manager and under the "Ports" section, see what COM port yours is using. In the screenshot I provided, my Arudino was using COM5.

Now we can head over to the Arduino IDE that we installed earlier.

  1. Open the Arudino IDE that you just downloaded
  2. From the Tools menu, select Board and then chose your board type (Arduino/Genuino UNO in my case)
  3. From the Tools menu, select the port your Arduino is connected to (COM5 in my case)
  4. From the File menu, select Examples > ArudinoISP > ArudinoISP
  5. Select Upload (Sketch > Upload or the small right facing arrow on the toolbar)

Once that uploads successfully, your Arduino is now an ISP Programmer! Disconnect it from your PC and close the Arduino IDE.

We can now connect to our Melzi board.

Step 2: Wiring It Up

Picture of Wiring It Up
  1. First off, you will have to turn off the power and remove all of the cables from the control box.
  2. Once it is free, flip it over to remove the screws holding the bottom plate on.
  3. Flip it over and remove the two screws on the side of the box holding up the power supply.

Once you've moved the power supply out of the way (be careful as some of the wires connected to it are not very long) you should be able to see the controller board. You can either remove the controller board from the housing or leave it in place. I chose to leave it in place to save time. If you do the same, find something to prop up the power supply.

Next, swap the USB/VREG jumper to USB so that we can power the board via USB. You can find it's location on the picture I attached.

Now we have to wire our Arduino to the Melzi controller board inside our CR-10. This will be done by connecting the ICSP pins on the Arduino to the ICSP pins on the Melzi. I've attached a few pictures to see how this is done. I recommend using female to female jumper wire to do this but any way you can wire this can work. It should be wired as follows:

Melzi -----> Arduino

MISO ----> MISO
5V --------> 5V
SCK -----> SCK
MOSI ---> MOSI
RESET -> Digital Pin 10
GND ----> GND

If you line up the Arduino and Melzi like I have in my picture, you can just connect the pins on each board as you see them (top left to top left, bottom left to bottom left etc..) with the exception of the RESET pin on the Melzi. The RESET pin on the Melzi needs to be connected to Digital Pin 10 on the Arduino. You can make this connection with a female to male jumper wire or you can do what I did and just slide a small pice of tinned wire in one side of a female to female jumper wire.

Step 3: Flashing the Bootloader

Picture of Flashing the Bootloader

We will now flash the bootloader to the Melzi board using the Arudino UNO as a programmer. First, we have to download the Sanguino add-on for our Arduino IDE:

  1. Download Sanguino from this link.
  2. Extract the contents of the zip to your Arudino hardware directory (usually Program Files (x86)\Arduino\hardware)

Now we can connect things to our PC and start flashing:

  1. Once everything is wired up correctly, connect the Melzi board to your PC via USB.
  2. Go back into Device Manager and verify which COM port the Melzi board is using.
  3. Now you can plug your Arduino board into the PC via USB as well.
  4. Open the Arduino IDE and from the Tools Menu select Board > Sanguino
  5. Select Tools > Processor > ATmega 1284P 16Mhz
  6. Select Tools > Port and choose the port for the Arduino board (NOT the Melzi)
  7. Select Tools > Programmer > Arduino as ISP
  8. Finally, Select Tools > Burn Bootloader

If everything was done correctly, it will now burn the bootloader to the Melzi board using the Arduino UNO as an ICSP programmer. At the bottom of the Arduino IDE window, there will be a small black box that should say it completed successfully.

IF EVERYTHING DID NOT WORK CORRECTLY, THERE IS AN ALTERNATIVE METHOD THAT YOU CAN USE!

So you're sure you did everything right and you tried to burn bootloader yet it didn't work? Here is an Alternative Method using a sketch made by a brilliant man named Nick Gammon.

  1. Download Nick Gammon's sketches from here. (Nick Gammon's web page can be found here)
  2. Extract the zip somewhere. Documents\Arduino is a good place.
  3. Back in the Arduino IDE, click File > Open
  4. Find the folder you extracted Gammon's sketches to. Inside that folder, there will be a folder named Atmega_Board_Programmer and inside that folder, a file named Atmega_Board_Programmer.ino. Select that file and open it.
  5. Now set your board (Tools > Board) to the Arduino UNO and your port (Tools > Port) to the com port of the Arduino UNO, and your programmer (Tools > Programmer) to the AVRISP mkII
  6. Upload the sketch.
  7. Wire everything up as previously stated in this guide and connect both boards via USB to your PC.
  8. With everything still set up for your Arduino (Board, Port and Programmer), in the Arduino IDE, select Tools > Serial Monitor.
  9. Inside the Serial Monitor window, there are two drop down boxes at the bottom right, set the first to "Both NL & CR" and the second to "1152000 baud".
  10. Some text should scroll by. If you get a message saying "Failed to enter ICSP programming mode" something is wired incorrectly.
  11. If you get the message "Type 'Q' to quit, 'V' to verify, or 'G' to program the chip with the bootloader ...", type G in the text box at the top of the window and click the send button.
  12. If preformed correctly, it will flash the bootloader.

Step 4: Flashing Firmware

Now that our Melzi has a bootloader burned to it, we can flash it via USB. You can disconnect the Arduino from the Melzi board now.

For the firmware I provided on the Facebook group, you will need to download Arduino v1.0.5 (I used 1.0.5-r2). You can find it on Arduino's website. You will also need to extract the Sanguino folder to the hardware folder of the Arduino v1.0.5 installation.

  1. Extract the firmware to a folder somewhere.
  2. Open Arduino v1.0.5
  3. File > Open and locate the folder you extracted
  4. Select the Marlin.ino file.

This will now open the firmware in Arduino, you can make whatever changes you'd like here. Most changes will occur in the Configuration.h file. Once you're happy with your firmware settings:

  1. Set your board to Sanguino W/ ATmega1284 or ATmega1284P (16MHz) (Tools > Board)
  2. Set your port to the COM port for the Melzi board (same as the previous step Tools > Serial Port)
  3. Set your Programmer to AVRISP mkII (Tools > Programmer).

Now you can hit upload and, if you've done everything right, you will now have a custom firmware on the CR-10. Any time you want to change something in your firmware, simply connect via USB, open Arduino v1.0.5, make your changes and hit upload!

MAKE SURE TO SWITCH THE USB/VREG JUMPER BACK TO VREG BEFORE CLOSING UP THE BOX!

Comments

BerndZ1 (author)2017-10-13

You need to choose the arduino serial port as programmer, not the melzi board's port.

Garden Troll (author)2017-10-08

It seems that the latest control boards may be coming with a bootloader. Mine bought from sainsmart did.

IssaO (author)2017-10-07

Hiw=everything went well until I tried to put the new firmware on the cr-10 board.I got the error:

"In file included from C:\Users\xxxxx\AppData\Local\Temp\arduino_build_789088\sketch\pins.h:61:0,

from C:\Users\xxxxx\AppData\Local\Temp\arduino_build_789088\sketch\MarlinConfig.h:33,

from C:\Users\xxxxx\Desktop\cr10\firmware\Marlin-1.1.x\Marlin-1.1.x\Marlin\Marlin.ino:31:

pins_RAMPS.h:48: error: #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."

#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."

^

exit status 1

#error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu."

"

I don't know why I get this error, I have followed the instructions to the letter. I used both arduino 1.05 r2 and 1.8.5, same errors. I chose the "Sanguino W/ ATmega1284 or ATmega1284P (16MHz)
" as in the instructions.

My printer is down now and I am stuck. Please help.

Thanks in advance

Verdann (author)2017-09-25

Does it have to be an Arduino or can it be one of the cheaper knockoffs?

DivBy0 (author)2017-09-20

Hi.

Thanx a lot for the outstanding instructable. And thanx to Nick Gammon, whom I never met.

My experience in the process:

1. The first run of burning a bootloader with "Arduino as ISP" failed. Really sure about the COM port to use?

2. The Nick-Gammon-Way worked flawlessly.

3. Was able to upload the recent Marlin build (1.1.5) with Arduino IDE 1.8.4 after some hiccups (could it be that there are some issues when trying to compile from a mounted network drive? Worked without any complaints from a local folder...) Don't forget to replace the standard config.h in the Marlin folder with the config.h from subfolder \example_configurations\creality\cr-10 before compiling.

4. Supervised Testprints successful

5. Eager to tweak around in the firmware. E3D v6 meet CR-10, CR-10 meet E3D v6. And a happy new year (sorry, endorphin rush)

Thanx again and cheers

lance.greene.5 (author)2017-09-18

So we have the new CR-10S with the new control board, and these pins are neither in the same position, nor grouped together like in these photos. Do you have any info on installing a bootloader with the new CR-10S control board?

KåreH (author)2017-09-13

Hi. What's the reason for why we need to use 1.0.5 and not the newer Arduino IDE?

Cuch (author)2017-09-09

Ok so I'm nervous about doing this, but I am going to have to eventually since I bought the E3 V6 Hotend and cut my stock wires too short to reuse. My controller has a USB input into it, would I be able to flash it with that? Also, does anyone have a video of this. I'm so unclear on how to manage this without an Arduino board.

Cuch (author)Cuch2017-09-09

Can you do this with a pi?

Cuch (author)Cuch2017-09-09

Also can't access the CR10 group until an admin approves.......

MarcosS115 (author)2017-09-03

The wires for the mega are:

Programmer Target
MISO (50) - MISO (50)
MOSI (51) - MOSI (51)
SCK (52) - SCK (52)
SS (53) - Reset (30)
5V - 5V
GND - GND

HeinD2 (author)2017-09-01

Can I use an USB ASP programmer and flash the bootloader onto the CR-10 board using a PC?

DonovanB17 (author)HeinD22017-09-01

Yes a USB ISP can be used instead of an UNO

mr.vibez (author)2017-08-22

Bootloader burned OK but now I get this error

avrdude: Expected signature for ATmega1284P is 1E 97 05

Double check chip, or use -F to override this check.

Wrong microcontroller found. Did you select the right board from the Tools > Board menu?

DaveG141 (author)2017-07-28

Yo, many many thanks, had to cutover to second method, and try a few times, but it works! Wanted to do some tweaking, and now that I have a bootloader and working config file, I can now proceed on with life. You're doing nerds work here, thank you!

Viperoftriforce (author)2017-07-02

What facebook group are you referring too?

This is the Facebook group:

https://www.facebook.com/groups/CrealityCR10/?ref=...

This is the post where he uploaded the stock version of the firmware:

https://www.facebook.com/groups/CrealityCR10/16644...

In the event you get the following error: "u8g_fntpgm_uint8_t" does not name a type; the great DonovanB17 resolved it. You must download U8glib 1.14, then in the Arduino IDE you go to Sketch > Import Library > Add Library and navigate to the downloaded u8glib_arduino_v1.14.zip.

You can download U8glib 1.14 here:

https://bintray.com/olikraus/u8glib/Arduino/1.14

This solution for the error is discussed here:

https://www.facebook.com/groups/CrealityCR10/16645...

DavidCaliri made it! (author)2017-07-06

This make is invaluable.

MontyFlange (author)2017-07-03

Used the second possess and it worked fine Thank you Both Donovan and Nick Gammon

SpudH (author)2017-06-29

I can't seem to upload the stock firmware. I was able to upload the Tiny Machines firmware, but would rather have the stock version. When I attempt to upload, I get a slew of Sanitycheck.h errors. Thanks

webliya (author)2017-06-22

Great Job. After hours of googling and trying different solutions that did not work, Nick Gammon's sketches worked. But Marlin does not boot on the board. I use the latest Marlin.

webliya (author)webliya2017-06-23

Correction. Board works via PC but the LCD shows only a blue screen? I have a typical Melzi style 12864 board named "LCD for Melzi V4". No matter waht I choose from Marlin it does not work!

bolsoncerrado (author)2017-06-13

Hey Don, thanks for the tutorial! So if we wanna use an ArduMEGA256 the wiring is the same? And which method do we follow from the 2 on STEP 3?


Thanks!

OK I think I succeeded, I got these while compiling the .hex though:

-----------
/Users/alex/Documents/Arduino/libraries/U8glib/utility/u8g_rot.c:48:1: warning: initialization from incompatible pointer type

u8g_dev_t u8g_dev_rot = { u8g_dev_rot_dummy_fn, NULL, NULL };

^

/Users/alex/Documents/Arduino/libraries/U8glib/utility/u8g_rot.c:48:1: warning: (near initialization for 'u8g_dev_rot.dev_fn')

-------------

Shall I be worried?

Thanks!

I guess this is it: http://www.gammon.com.au/images/Arduino/Minimal_Arduino22.png

OriginalHotrodder (author)2017-06-09

Great instructions, thank you for taking the time to create this. One thing you might add after burning the bootloader is the fact that burning the bootloader wipes your original program. Until new firmware is uploaded you will see a blank LCD, don't let that freak you out.

HuyT54 (author)2017-04-09

Do you know what Melzi board version the cr-10 comes with?

rmacewen1 (author)2017-04-02

Great job Don!

cr-10-monkeyluver (author)2017-03-29

I don't get it...... I think a video would be more helpful.

DIY Hacks and How Tos (author)2017-03-26

Great first instructable. Very well written.

About This Instructable

19,770views

35favorites

License:

Add instructable to: