[SOLVED] Bootloader burning to ATmega1284p using cheap UNO clone (ATmega328p)

Hi,

I went trough several manuals how to burn a bootloader on 3D printer (in my case Ender 3). I should point out, that I'm total noob in electronics/programming but I will try to describe the problem and my partial solution in detail as clear as possible. Based on the problem description below, can someone please write me a concise manual, what to do to burn bootloader without error?

  1. So first of all, I've bought this cheap UNO clone (see attached image), connected it to PC and installed CH341SER driver so it's now visible as "USB-SERIAL CH340" as can be seen in 02image.

  2. I followed instruction an try to upload bootloader onto this UNO clone (used ISP file "File/Examples/11.ArduinoISP"; selected UNO board "Tools/Board/Arduino Genuino UNO; selected port COM9; and selected programmer option "AVRISP mkII"). In other words, I worked as described in numerous manuals. Unfortunately, following error popped:

Arduino: 1.8.7 (Windows 7), Board: "Arduino/Genuino Uno"

Sketch uses 4402 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 482 bytes (23%) of dynamic memory, leaving 1566 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xf3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xf3
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Any suggestions why this happened and how to solve this?
Anyway, I try to solve this problem on my own (99.99% wrong approach, but.. somehow it worked, continue reading)

  1. So i tried to upload bootloader using different board (not "Arduino/Genuino UNO"). The package of boards I chose and install was "Atmel AVR Xplained-minis by Atmel University France version 0.6.0" containing board "Atmega328p-xmini". I used this exact board to upload bootloader on this UNO clone and the process was successful. After upload of bootloader, I tried to upload simple "Blink" example and the LED of UNO clone started to blink. This was impossible before bootloader upload. So I guess the upload was successful even when "Atmega328p-xmini" board was used for UNO clone (strange?).

  2. I continued with the bootloader burn process as described in manuals. I can mention two of these from Teaching Tech (Ender 3: How to install a bootloader and update firmware - YouTube) and TH3D Studio (Bootloader Flashing Guide - CR-10/Ender 2/Ender 3/Ender 5/X3S/X5S/Wanhao i3 - 1284p Boards - YouTube). I followed the wiring in these manuals, briefly:

Ender 3 (Melzi) -----> UNO clone

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

When I completed this wiring (via jumper wires), I checked the tightness of joints connection and connected the UNO clone to PC. Melzi board LED turned on as well as 3D printer LCD (connection seemed to be ok). I proceed to step of bootloader burning. In "Tools/Board" I've chose "Sanguino" (installed from "Sanguino by Kristian Sloth Lauszus version 1.0.2" using boards manager), selected processor "ATmega1284 or ATmega1284p (16MHz)" and appropriate com port (COM9). Next, I selected programmer option "Arduino as ISP" and clicked on "Burn Bootloader". Here is the error I got:

Arduino: 1.8.7 (Windows 7), Board: "Sanguino, ATmega1284 or ATmega1284P (16 MHz)"

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
Error while burning bootloader.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I have tried this exact setup and procedure using different PC and the error was identical :frowning:

So what I had done so far?
I manage to upload bootloader onto UNO clone using different board selection.
However I was not able to burn bootloader from this UNO clone to ATmega1284p (16MHz) on the Melzi board of Ender printer.

Any suggestions what should I do to complete the process of bootloader burning? It's driving me nuts already :((

Possible options ("my" theory):
A) Upload bootloader using "Arduino/Genuino UNO" board, so it can be successfully burned using programmer option "Arduino as ISP".

B) Somehow add option "ATmega328p-xmini" to programmer, so the bootloader can be uploaded without error.

My apologies for the non-technical language and inaccurate description, my knowledge is limited. My English also sucks :frowning: Can someone please help me?





How did you disable auto-reset on the Uno?

I didnt disable auto-reset (at least I dont know about it..)

Can you guess what I'm going to suggest?

Optiboot resets fast. No need to disable the auto-reset. But you should select "Arduino as ISP" as programmer.

Juraj:
Optiboot resets fast.

One second is the timeout. Guess what the avrdude timeout is?

No need to disable the auto-reset.

Half the Unos in my possession disagree.

it depends on the bootloader version, but newer Optiboot versions don't need to suppress the auto-reset with a capacitor on programmer board. and https://www.arduino.cc/en/Tutorial/ArduinoISP mentions it only for Mega as programmer.

sure is with "programmer option "AVRISP mkII"" it will not work

Connect 10uF capacitor between RESET and GND on your UNO.

Arduino as ISP in v1.8.7 uses -carduino in the command so you need to disable auto-reset on the source (programmer) board as @Coding Badly wrote.

Budvar10:
Connect 10uF capacitor between RESET and GND on your UNO.

Arduino as ISP in v1.8.7 uses -carduino in the command so you need to disable auto-reset on the source (programmer) board as @Coding Badly wrote.

I use no-name Nano with Ch340 and Uno bootloader as programmer. I flashed Uno, Mega, 1284 with it today with IDE 1.8.7, without the cap,

Thanks to everybody for fast response. Okay, I'll try disabling auto-reset, maybe even put the capacitor between RESET and GND. But first thing first, disable auto-reset. I found method how to do it permanently, copy-paste text follows..

"Method B is what I used on my Arduino PCB. I just grabbed an old pair of metal tweezers with flat and rather thick tips (about the same width as the smd capacitor) and heated it up with a small gas torch until it glowed in dark orange. The tips must be massive enough to store some of the heat till you get to the PCB. How much heat is required can and should be tested before with some piece of solder. It should melt easily when touched by the tweezers, but the right temperature ought to be approached from below its melting point ( not the tweezers' :slight_smile: ). Then basically grab the capacitor on both ends, making good contact with the tinned parts without touching the PCB, and just lift it. DONE."

This was taken from DisablingAutoResetOnSerialConnection, are these instructions valid and usable for my UNO clone?

If yes and auto-reset can be disable permanently like this, can anyone please point me to the right direction where is the capacitor to remove? Marking the capacitor in the 01image I've upload in the first post and re-posting it would be most helpful.. thanks in advance!

To permanently disable auto-reset, carefully break the connection marked by the red arrow using a file or knife.

To restore auto-reset, solder a bridge at the same place.



A000066_SPL.jpg

lukeccc:
This was taken from DisablingAutoResetOnSerialConnection, are these instructions valid and usable for my UNO clone?

Regardless of whether or not it would work I would not do it.

lukeccc:
Okay, I'll try disabling auto-reset, maybe even put the capacitor between RESET and GND. But first thing first, disable auto-reset.

The purpose of the capacitor across RESET and GND is to disable auto-reset. If you have a reasonably sized capacitor start with that.

Oh god, I'm so stupid.. sorry, I just wanted to flash my new 3D printer, this is like whole new world to me :confused:
Anyway I can try this non-invasive solution (10 uF capacitor between RESET and GND on UNO clone). I found this scheme how to do it (00image) and applied it to my case (01image), is it correct please?





00image.png

Looks about right. Make certain you get the polarity correct.

@lukeccc, first try only to set the right programmer in Tools menu "Arduino as ISP".

with Arduino AVR core 1.6.23 the "Arduino as ISP" doesn't work because it wants to use STK500v2, which is not supported by the programmer sketch. it is already fixed but not released yet.
use 1.6.21 or in programmers.txt make this change

MANY THANKS TO ALL OF YOU!!!

I successfully burned bootloader on my melzi board, the thing with cap worked perfectly. I flashed new firmware and now I can continue with other upgrades (BLtouch, Rpi..).

lukeccc:
MANY THANKS TO ALL OF YOU!!!

I successfully burned bootloader on my melzi board, the thing with cap worked perfectly. I flashed new firmware and now I can continue with other upgrades (BLtouch, Rpi..).

did you try it without the cap, with the right setting?

lukeccc:
I successfully burned bootloader on my melzi board, the thing with cap worked perfectly. I flashed new firmware and now I can continue with other upgrades (BLtouch, Rpi..).

Excellent. I'm glad it went well.

MANY THANKS TO ALL OF YOU!!!

You are welcome.

Juraj:
did you try it without the cap, with the right setting?

Hi Juraj,

I've tried several setups to upload bootloader onto UNO clone using example command "ArduinoISP" and appropriate com port:

  1. Use of options "Arduino/Genuino UNO" and "AVRISP mkII" as board and programmer - negative result
  2. Use of options "Arduino/Genuino UNO" and "Arduino as ISP" as board and programmer - negative result
  3. Use of combination of several other predefined board and programmers - negative result
  4. Use of options "ATmega328p-xmini" and "AVRISP mkII" as board and programmer - positive

Next, I tried several combinations without cap to burn bootloader onto melzi board (ATmega1284p 16MHz):

  1. Use of options "Sanguino", "ATmega1284 or ATmega1284p (16MHz)" and "Arduino as ISP" as board, processor and programmer - negative result
  2. Use of options "Sanguino" and "ATmega1284 or ATmega1284p (16MHz)" as board and processor and several different programmers including "AVRISP mkII", "ArduinoISP", "Parallel Programmer" or various predefined Atmel programmers (.. I was desperate) - negative result

So I solder 10 uF capacitor between RESET and GND of UNO clone using jumper wires, left other settings unchanged and try to use the options "Sanguino", "ATmega1284 or ATmega1284p (16MHz)" and "Arduino as ISP" as board, processor and programmer - and voila! bootloader was burned :slight_smile: