Hello there,

i had a problem with my apm. After firmware upload, the apm stopped work. Only green light(alive led) turn on when powered, and no mo recognized from mission planner.

When i plug/unplug i can hear the dlindlon sound from windows 7, i can see in devices manager the atmega2560 plugged in, but i have error of connection in mission planner, by usb connection and firmware upload fails.

So reading thousends of topics over the net, i understand thet can be a bootloader problem. The main chip(atmega2560) lost his bootloader, so its no more possibile to interact with pc by usb.

Im tryng in this day to flash a new bootloader over the icsp header near the micro usb port, but something is not working....

Im using an arduino nano as isp programmer and winavr to command it.

The connection looks ok and this is the command that i send by cmd:

E:\Droni\APM\AVRdude + bootloader atmega2560>avrdude.exe -P com7 -F -v -b 19200
-c avrisp -p m2560 -U flash:w:stk500boot_v2_mega2560.hex -U efuse:w:0xF4:m -U hfuse:w:0xD9:m -U lfuse:w:0xFF:m -U lock:w:0x0F:m

and this is the result:

avrdude.exe: Version 6.0.1, compiled on Oct 17 2013 at 21:37:20
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is "E:\Droni\APM\AVRdude + bootloade
r atmega2560\avrdude.conf"

             Using Port                    : com7
             Using Programmer              : avrisp
             Overriding Baud Rate          : 19200
             AVR Part                      : ATmega2560
             Chip Erase delay              : 9000 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     8    0 no       4096    8      0  9000
  9000 0x00 0x00
               flash         65    10   256    0 yes    262144  256   1024  4500
  4500 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
               lock           0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               calibration    0     0     0    0 no          1    0      0     0
     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0
     0 0x00 0x00

             Programmer Type : STK500
             Description     : Atmel AVR ISP
             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.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude.exe: Device signature = 0x1e9801
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as D8
avrdude.exe: safemode: efuse reads as FC
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be per
formed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "stk500boot_v2_mega2560.hex"
avrdude.exe: input file stk500boot_v2_mega2560.hex auto detected as Intel Hex
avrdude.exe: writing flash (256458 bytes):

Writing | ################################################## | 100% 0.06s

avrdude.exe: 256458 bytes of flash written
avrdude.exe: verifying flash memory against stk500boot_v2_mega2560.hex:
avrdude.exe: load data flash data from input file stk500boot_v2_mega2560.hex:
avrdude.exe: input file stk500boot_v2_mega2560.hex auto detected as Intel Hex
avrdude.exe: input file stk500boot_v2_mega2560.hex contains 256458 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.06s

avrdude.exe: verifying ...
avrdude.exe: 256458 bytes of flash verified
avrdude.exe: reading input file "0xF4"
avrdude.exe: writing efuse (1 bytes):

Writing |                                                    | 0% 0.00s ***faile
d;
Writing | ################################################## | 100% 0.13s

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

Reading | ################################################## | 100% 0.02s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
             0xfc != 0xf4
avrdude.exe: verification error; content mismatch

avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as D8
avrdude.exe: safemode: efuse reads as FC
avrdude.exe: safemode: efuse changed! Was f4, and is now fc
Would you like this fuse to be changed back? [y/n] n
avrdude.exe: safemode: Fuses OK (H:F4, E:D8, L:FF)

avrdude.exe done.  Thank you.

As u can see there is some problem by flashing the fuse bits, in the last raw of my copy/past there is a question "Would you like this fuse to be changed back? [y/n] n" and i can understand why there is this question...

I found the original tutorial here.

And i tryed with the bootloader inside the arduino IDE path, and the bootloader from here

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Use proper power module and remove all the red wires coming from esc
  • i checked the 3.3v and its look good, no fuse/diode blowed up, never powerd with more then 5.3volt by bec

This reply was deleted.

Activity