Bootloader Burning Issue On 3D printer Board

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone for the last 5 hours i have been troubleshooting and googling for what i think is a bricked board.

The board i am talking about is an Anet 1.0 Board with the Atmega1284P

I flashed an arduino mega with the arduino ISP sketch and i can not get the bootloader to burn.

The error i get is this 

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x1f006
         0x61 != 0x65
avrdude: verification error; content mismatch

avrdude done.  Thank you.

Error while burning bootloader.

Before you ask 

1) The connections are correct i checked 5 times

2)The Anet V1.0 files for the Arduino IDE are included in the Skynet 3D firmware (which i tried to flash before the board freaked out)

3)This was not my first time flashing the firmware

4) The options i used are 

4.1) Board : Anet V1.0

4.2) Port : It is connected on COM 3

4.3) Programmer : Arduino as ISP

4.4) Burn Bootloader

 

Also to help a bit in troubleshooting

Verbose output while compiling and uploading were enabled and this is the output

D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\tools\avr/bin/avrdude -CD:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -cstk500v1 -PCOM3 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xD6:m 

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : stk500v1
         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 : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.02s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.03s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

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

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

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

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDA"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDA:
avrdude: load data hfuse data from input file 0xDA:
avrdude: input file 0xDA contains 1 bytes
avrdude: reading on-chip hfuse data:

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

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xD6"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xD6:
avrdude: load data lfuse data from input file 0xD6:
avrdude: input file 0xD6 contains 1 bytes
avrdude: reading on-chip lfuse data:

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

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\tools\avr/bin/avrdude -CD:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -cstk500v1 -PCOM3 -b19200 -Uflash:w:D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\anet\avr/bootloaders/atmega/ATmegaBOOT_168_atmega1284p.hex:i -Ulock:w:0x0F:m 

avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : stk500v1
         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 : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.02s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\anet\avr/bootloaders/atmega/ATmegaBOOT_168_atmega1284p.hex"
avrdude: writing flash (128986 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 128986 bytes of flash written
avrdude: verifying flash memory against D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\anet\avr/bootloaders/atmega/ATmegaBOOT_168_atmega1284p.hex:
avrdude: load data flash data from input file D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\anet\avr/bootloaders/atmega/ATmegaBOOT_168_atmega1284p.hex:
avrdude: input file D:\Pc Backup\3D Printer\Firmware\Skynet3d-master\arduino-1.8.0\hardware\anet\avr/bootloaders/atmega/ATmegaBOOT_168_atmega1284p.hex contains 128986 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x1f006
         0x61 != 0x65
avrdude: verification error; content mismatch

avrdude done.  Thank you.

Error while burning bootloader.

I am sorry for the length of this post and i hope i find a solution because i need to get the thing up and running ASAP

 

-- THANK you in advance --

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
avrdude: verification error, first mismatch at byte 0x1f006
         0x61 != 0x65

Is the verification error >>always<< there?

 

Note that the above mismatch represents just a single bit.

 

Despite your having confirmed the connections, This seems like a signalling issue.  What does your ISP wiring harness look like?  Is it short and tidy?  Or long and messy?

 

Perhaps other hardware on the target board is interfering a bit with ISP.

 

I would try tickling the ArduinoISP sketch to drive SPI at a slower speed to see if that helps.  I don't know what version of the Arduino IDE you're using, nor what version of the ArduinoISP.ino sketch it ships with, but look for a function called spi_init():

void spi_init() {
  uint8_t x;
  SPCR = 0x53;
  x=SPSR;
  x=SPDR;
}

That sets the slowest SPI prescaler, which is /128.  This results in 125 kHz.  This is slow enough for most any target, but if there is a signalling issue, running slower would be better.

 

There is a bit-banged SPI version of the sketch here:

https://pastebin.com/60xYhyq0

Read all of the comments at the beginning of the file to understand how to enable bit-banged SPI.  Have a look at the function the top of the function avrisp() to understand how to change the bit-bang SPI speed.  Basically you connect to the Arduino running the modified ArduinoISP sketch over a serial console at 19200 baud, then press the ENTER key 5 times to begin configuring the speed.  When you're done, simply exit the serial console and proceed to use the the Arduino as a programmer as you normally would.

 

Make sure you're in bit-bang mode by resetting the Arduino while shorting MODE_BUTTON (which is #defined as pin 9) to ground.  If you've connected a heart-beat LED to pin 6 (same as normal sketch), it will beat slow for bit-bang SPI and fast for hardware SPI.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Dec 7, 2017 - 12:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It worked the bootloader was burned.

Solution :

The mistake was mine i thought i got rid of everything that was connected to the board that may used SPI except something very small i did not notice the micro SD card which was still plugged into the board.