Unable to upload Mralin 3D printer firmware to board

Hello all,
I've posted this question on a 3D printing forum but got no responses, so I'm going to try putting it here.

I bought a new Anet A8 3D printer, but the board it ships with has an outdated version of Marlin on it. I am trying upload get the latest version, but I get the following error message:

Sketch uses 104096 bytes (81%) of program storage space. Maximum is 126976 bytes.
Global variables use 4083 bytes of dynamic memory.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -carduino -PCOM4 -b57600 -D -Uflash:w:C:\Users\wdwe_\AppData\Local\Temp\arduino _build_641910/Marlin.ino.hex:i

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.

An error occurred while uploading the sketch

Either that one or "The port you selected was disconnected or does not exist."
The printer also freezes while trying to use the buttons to navigate the LCD screen.
I am using the correct board in the IDE and configuration files.

To try and fix these issues I have tried:
-Installing the CH340 drivers (no effect)
-Checking the power supply output (good at 11.8 - 20.0 v)
-Changing the printers baud rate from its bizarre default to the overriding baud rate in the Arduino error message (no effect)
-Power cycling (no effect)

I think the board I got is no good, but would greatly appreciate second opinions before pestering Anet for a new one.

Thank you

I tried again just to see if magic was on my side, and I now get this error...

Sketch uses 104096 bytes (81%) of program storage space. Maximum is 126976 bytes.
Global variables use 4083 bytes of dynamic memory.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -carduino -PCOM4 -b57600 -D -Uflash:w:C:\Users\wdwe_\AppData\Local\Temp\arduino_build_86743/Marlin.ino.hex:i

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATmega1284P
Chip Erase delay : 55000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 10 128 0 no 4096 8 0 9000 9000 0xff 0xff
flash 65 10 256 0 yes 131072 256 512 4500 4500 0xff 0xff
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino

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

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

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
Hardware Version: 2
Firmware Version: 0.4611299

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

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

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

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

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
Vtarget : 420030.5 V
Varef : 200621011.2 V
Oscillator : 0.531 Hz
SCK period : 8783107.7 us

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

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

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

avrdude done. Thank you.

the selected serial port
does not exist or your board is not connected

Make sure COM4 is the port of your board. If you unplug the USB cable from your computer and then open the Arduino IDE's Tools > Port menu then COM4 should have disappeared from the menu.

Ne0Wolf7:
-Changing the printers baud rate from its bizarre default to the overriding baud rate in the Arduino error message (no effect)

The baud rate in the Arduino error message is about the baud rate that the bootloader communicates at. This is completely different from the baud rate that the 3D printer firmware communicates at and there is no need for the two of them to match.

Does the controller board for that printer have the arduino bootloader on it? Does it have the DTR pin wired to reset for autoreset?

It's possible that one or both of these things are not the case. Consult the documentation from the printer manufacturer regarding updating the firmware for more information - they will likely describe the process that you need to use. There may be a jumper needed to enable autoreset, or it may not be designed to be updated via serial at all, and need an ISP programmer to update it.

I doubt the board is "no good", more than likely it is just does not have a bootloader in it.

You will need a Programmer to either install a bootloader and then the code, or just install the code.

My Migbot (early Prusa i3 model) was having issues that I thought was software but was really an assembly error & wiring harness error. I tried bootloading the board via the ICSP header, which then didn't work for serial downloads (not sure if the board has the Reset circuit to support software reset), then downloaded latest Marlin directly via the ICSP header, which didn't work because we couldn't figure out the configuration changes needed for our printer (very new to 3D printing ourselves), so ended up programming the board with the original program via the ICSP header and at the same time got our hardware assembly & cabling problems fixed.

So, I'd recommend getting a Programmer and downloading via the ICSP header.

COM4 does indeed disappear from the menu once I unplug or power down the board.

I would be very surprised if the board lacked an Arduino bootloader because it is supposed to come with Marlin on it, but an old version.
There are no open pins on this board, it is made specifically for this purpose, so I'm not one hundred percent sure if DTR is wired to auto-reset, and there are no jumpers on the board at all (or anything labeled DTR). I also doubt it needs an ISP programmer as the guide I tried to use to do this (https://all3dp.com/2/anet-a8-firmware-which-to-choose-and-how-to-change-it/) or any others I looked at made no mention of needing to do any of that. Also, there is no manufacturer's documentation for updating the firmware.

Nonetheless, I am more than willing to try and fix it before sending halfway around the planet for a new one.

What exactly is a programmer? Also, the only pins on this board not used up already is a 6-pin connector., Does this sound like what I would need to plug into?

EDIT: It's not a six pin header, its a 5X2 pin header, that was a typo

Is it a 2x3 6-pin header? That suggests an ISP programming header.

That guide would only work if it has a bootloader and the autoreset circuit. The fact that it does not work (and that resp=0x00, not other random values) strongly suggests that it is lacking one of those two things.

The autoreset circuit is a connection between one pin of the serial adapter chip on the board, to a pin on the atmega1284p - if it is there (and there wasn't a jumper to enable/disable it) the only way you'd know it is by examining the board to see if the DTR pin of the serial chip is connected to anything.

5x2 header can also be an ICSP header.

You may be able to find similar for less, read carefully to see that it can program a 2560 or whatever processor is on your board.

I actually had a typo before, I have a 5X2 ten pin header labeled J3.
I'll get a closer looks at the board to try and find the DTR pin.

My board has an atmega 1284p.

Thank you all for your help thus far, by the way

Alright, bad news:
After some researching, I found out that you can use an Arduino (an Uno in my case) as an ISP. I followed this tutorial and got the following error message:


C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -carduino -PCOM5 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xD6:m

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xcb

avrdude done. Thank you.

Error while burning bootloader.


Looks quite familiar...

While investigating why this would fail, I found a schematic of the board I am trying to get the bootloader onto on Github. Attached is the pinout of the J3 array I thought would be used for the ISP.

This does not match the ISP 10 pin pinout. This makes it seem the board cannot be reprogrammed, but this must be impossible, otherwise, there would be nothing on it as is...

What am I missing?

I've just made another attempt this time using jumpers into my ribbon cable to try and get the relevant pins to match, and it didn't work. I was given this error message:

Arduino: 1.8.9 (Windows 10), Board: "Anet V1.0"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -carduino -PCOM5 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xD6:m

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega1284P
Chip Erase delay : 55000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 10 128 0 no 4096 8 0 9000 9000 0xff 0xff
flash 65 10 256 0 yes 131072 256 512 4500 4500 0xff 0xff
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

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

Do you have a 10 uF capacitor connected between the reset and ground pins on the board you're using as an Arduino as ISP?

No, I don't. Re-reading the guide, I now realize I will need it because my Arduino as ISP is an Uno.
Another thing I didn't do was connect 5v to 5v or ground to ground, because the board I'm trying to burn the boot loader to can only he sufficiently powered by its power supply.

It's fine to not connect 5 V on the Arduino as ISP to 5 V on the target board if the target board is powered separately. However, you absolutely do need to connect the grounds.