loading a hex to mega2560 with avrdude?

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

I captured this verbose report from avrdude while trying to upload a hex file to a new mega2560 arduino. Note that it says it is an AVRISP, which I dont get exactly, and it aborts at the erase command, which I also dont get.

Attachment(s): 

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is the avrdude command I use:

 

avrdude -patmega2560 -cwiring -P\\.\COM55 -D -U flash:w:phonec.hex:i

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
Note that it says it is an AVRISP, which I dont get exactly
Well you can see why it said that:

avrdude.exe: Recv: A [41]
avrdude.exe: Recv: V [56]
avrdude.exe: Recv: R [52]
avrdude.exe: Recv: I [49]
avrdude.exe: Recv: S [53]
avrdude.exe: Recv: P [50]
avrdude.exe: Recv: _ [5f]
avrdude.exe: Recv: 2 [32]

The STK500 just told avrdude it was "AVRISP_2". So avrdude is just reporting what it was told.

 

As to the erase failure. That happens here:

avrdude.exe: Send: . [1b] . [13] . [00] . [07] . [0e] . [12] . [09] . [00] . [ac] . [80] . [d5] D [44] . [a7]
avrdude.exe: Recv: . [1b]
avrdude.exe: Recv: . [13]
avrdude.exe: Recv: . [00]
avrdude.exe: Recv: . [02]
avrdude.exe: Recv: . [0e]
avrdude.exe: Recv: . [12]
avrdude.exe: Recv: . [c0]
avrdude.exe: Recv: . [d6]

If you dig out a copy of the protocol document for this ("AVRISP/STK500v2") you should be able to decode what was requested and what the response actually was here.

EDIT: having looked it up I'm afraid it tells you nothing. The:

avrdude.exe: Recv: . [c0]

is simply STATUS_CMD_FAILED. No reason is given.

Last Edited: Tue. Nov 22, 2016 - 11:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Mr Stampl from Ulan Bator. It suddenly occurred to me that adding the -D cmd to suppress the erase works, because the flash still gets written page by page. I tried it and it works. You sir are a genius.

 

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The following is the AVRdude command line that I use for the AVRISP-MKII.  Note that with the use of the programmer address (last four digits of the programmer serial number) following the "-P" switch, I am able to service several programmers that might be connected to the PC without having to change out any cabling.

 

avrdude -p m328p -P usb:34:50 -c avrispmkii -U flash:w:USART0_328P_Test.hex

The concept of multiple AVRISP-MKII connectivity Is even described in the latest release of the AVRdude manual.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can program using my atmel programmers just fine. I can program unos using the dude and the uno bootloader just fine. Couldnt program a mega2560 using dude and bootloader until yesterday when JStampfl showed me -D trick.

 

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Copied it from Arduino upload