AVRdude5.8 binary for Windows?

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

Does anybody know where I can find a copy of AVRDude5.8 that's built for Win32? I've spent the past 2 hours or so trying to find one, with zero success. WinAVR only has 5.6, AVRDude's own site only has the source, and the only precompiled copies I've managed to find so far are for Linux or OSX.

Why: I can't get AVRDude5.6 to successfully flash a Mega48p in Eclipse. I've successfully flashed a Butterfly with Eclipse and 5.6, and I've successfully flashed the Mega48p using the same hardware setup via AVR Studio. The one specific thing that just won't work is 5.6 + Mega48p (using -pm48 -F). I'm pretty much out of ideas besides trying the newest version :(

There's no place like ~/

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

Was there a problem with the code in 5.6? Or is it the fact that mega48p was not supported in the configuration file? If it's the latter then a config file with the proper device support should work with 5.6.

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

So far, nobody has contributed an avrdude.conf snippet for the ATmega48P, sorry.

Your only chance is to figure out what's going wrong. You could start with comparing
the respective avrdude.conf parameters against the STK500v2 parameters in the
partdescription XML file (which is part of your AVR Studio installation).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Jörg,

Last night, I remember seeing one of your posts where you mentioned that AVRdude 5.7 had some fatal flaw specific to the JTAGICE2. Do you have any other posts elaborating on it, or suggestions for specific things to look for that might suggest that this could be related?

In particular, when using the JTAGICE2 in ISP mode, is there any functional difference between connecting via serial and connecting via USB, or did Atmel just use a normal USB-UART bridge chip that makes them both look alike to everything "downstream"? Also, from the perspective of a client like AVRDude or AVR Studio, does a JTAGICE2 in ISP mode look the same as a STK500, or does it need special handling?

I'm mentioning this because one of the first things I tried to do last night was to cut 'n paste the m48 definition to a new one called m48p, with the final signature byte changed to 0x0a. That got AVRdude to quit complaining that it was an unknown/unsupported chip, but the outcome was the same as -pm48 -F. Also, I've seen lots of postings from others who had a similar problem, but a different programmer, and for them -pm48 -F seemed to fix it.

I'll try it with my Dragon tonight when I get home from work, but wanted to get your thoughts since you'll probably be asleep by the time I get home from work and have a chance to try more experiments. ;)

Thanks!

There's no place like ~/

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

> Do you have any other posts elaborating on it, or suggestions for
> specific things to look for that might suggest that this could be related?

That's unrelated. The bug manifests itself by immediately causing a
memory protection violation for those programmers affected. AVRDUDE 5.6
didn't suffer from it, and alas, it's still not completely fixed in 5.8.

> In particular, when using the JTAGICE2 in ISP mode, is there any
> functional difference between connecting via serial and connecting via
> USB, or did Atmel just use a normal USB-UART bridge chip that makes them
> both look alike to everything "downstream"?

It's not a USB-UART bridge, so on the host computer, you cannot use a generic
CDC driver. Anyway, the communications protocol is the same between both,
and the protocol requires that you say "Hello!" to the ICE first. That way,
the ICE determines which of the paths is used to communicate, until you say
"Good bye!" again, at which point it will start over from zero (including
detaching from the USB, and re-attaching).

> Also, from the perspective of a client like AVRDude or AVR Studio, does
> a JTAGICE2 in ISP mode look the same as a STK500, or does it need special
> handling?

It looks terrible. :-) It mixes both, the AVRISPmkII and the JTAG ICE mkII
protocols. AVRISPmkII packets are wrapped up in JTAGICEmkII packets. This
kind of mixture has been repeated ad nauseum in other tools, and that
mixture is also what causes the current memory violation problems (because
I tried to separate the individual programmer models more than they used to
be, and moved global variables into per-programmer local objects).

> I'm mentioning this because one of the first things I tried to do last night
> was to cut 'n paste the m48 definition to a new one called m48p, with the final
> signature byte changed to 0x0a.

That's a good start. Right under the initial stuff, you'll find the STK500v2
(aka. AVRISPmkII) protocol parameters. Please go ahead, and compare them to the
respective protocol parameters in the XML file.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Hmmm. So far, it's not encouraging. The STK500, STK500_2, STK600, and JTAGICEmkII sections of ATmega48.xml and ATmega48P.xml are absolutely identical.

Next experiments on tonight's agenda:

* attempt JTAGICEmkII flash of Mega48P using serial cable instead of USB

* attempt flash of Mega48P using Dragon

There's no place like ~/

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

> he STK500, STK500_2, STK600, and JTAGICEmkII sections of
> ATmega48.xml and ATmega48P.xml are absolutely identical.

I was afraid of that. :-/

I'll have to look around whether I've got an ATmega48 (non-P)
around, so I can test it myself.

> attempt JTAGICEmkII flash of Mega48P using serial cable instead of USB

Unlikely to change something, because your communication appears to work
pretty well.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

p.s.: Can you figure out whether something has been written to the
flash ROM at all? The readback value is 0x00, which might mean
completely wrong data has been written, or just the readback doesn't
work. (A complete write failure should result in 0xFF rather than
0x00.)

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

OK, I flashed it with AVRdude(5.6), and read it back using AVR Studio.

Flashing with the Dragon worked. Flashing with the JTAGICE2 didn't.

The command that did the flashing:

C:\Users\root>avrdude -pm48 -cjtag2isp -Pcom1 -B8 -F -Uflash:w:"d:\dev\avr\c\blinky\default\Blinky.hex":i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.23s

avrdude: Device signature = 0x1e920a
avrdude: Expected signature for ATMEGA48 is 1E 92 05
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:\dev\avr\c\blinky\default\Blinky.hex"
avrdude: writing flash (150 bytes):

Writing | ################################################## | 100% 0.48s

avrdude: 150 bytes of flash written
avrdude: verifying flash memory against d:\dev\avr\c\blinky\default\Blinky.hex:
avrdude: load data flash data from input file d:\dev\avr\c\blinky\default\Blinky.hex:
avrdude: input file d:\dev\avr\c\blinky\default\Blinky.hex contains 150 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.26s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x19 != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: lfuse changed! Was e2, and is now fe
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was dc, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: efuse changed! Was 1, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK

Here's what I got back:

:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
:10002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0
:10003000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0
:10004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0
:10005000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0
...
:100FD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21
:100FE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11
:100FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01
:00000001FF

Here's the output from using the Dragon:

C:\Users\root>avrdude -pm48 -cdragon_isp -Pusb -F -Uflash:w:"d:\dev\avr\c\blinky\default\Blinky.hex":i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.17s

avrdude: Device signature = 0x1e920a
avrdude: Expected signature for ATMEGA48 is 1E 92 05
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:\dev\avr\c\blinky\default\Blinky.hex"
avrdude: writing flash (150 bytes):

Writing | ################################################## | 100% 0.32s

avrdude: 150 bytes of flash written
avrdude: verifying flash memory against d:\dev\avr\c\blinky\default\Blinky.hex:
avrdude: load data flash data from input file d:\dev\avr\c\blinky\default\Blinky.hex:
avrdude: input file d:\dev\avr\c\blinky\default\Blinky.hex contains 150 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.16s

avrdude: verifying ...
avrdude: 150 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

There's no place like ~/

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

with debugging info:

C:\Users\root>avrdude -pm48 -cjtag2isp -Pcom1 -B8 -F -Uflash:w:"d:\dev\avr\c\blinky\default\Blinky.hex":i -v -v

avrdude: Version 5.6, compiled on Mar  5 2009 at 09:59:30
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "C:\WinAVR-20090313\bin\avrdude.conf"

         Using Port                    : com1
         Using Programmer              : jtag2isp
         Setting bit clk period        : 8.0
avrdude: stk500v2_jtagmkII_open()
avrdude: jtagmkII_getsync(): Sending sign-on command: 0x86 (28 bytes msg)
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              5.44
  hardware version:              0
S_MCU:
  boot-loader FW version:        255
  firmware version:              5.44
  hardware version:              1
Serial number:                   07:00:00:00:0a:21
Device ID:                       JTAGICEmkII
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, zu bytes): 0x80 (1 bytes msg)
avrdude: jtagmkII_getsync(): Sending get sync command: 0x80 (1 bytes msg)
         AVR Part                      : ATMEGA48
         Chip Erase delay              : 45000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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     5     4    0 no        256    4      0  3600  3600 0xff 0xff
           flash         65     6    64    0 yes      4096   64     64  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 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 : JTAGMKII_ISP
         Description     : Atmel JTAG ICE mkII in ISP mode
avrdude: jtagmkII_getparm()
avrdude: jtagmkII_getparm(): Sending get parameter command (parm 0x06): 0x81 (3 bytes msg)
         Vtarget         : 5.1 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.23s

avrdude: Device signature = 0x1e920a
avrdude: Expected signature for ATMEGA48 is 1E 92 05
avrdude: safemode: lfuse reads as E2
avrdude: safemode: hfuse reads as DC
avrdude: safemode: efuse reads as 1
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:\dev\avr\c\blinky\default\Blinky.hex"
avrdude: writing flash (150 bytes):

Writing | ################################################## | 100% 0.48s

avrdude: 150 bytes of flash written
avrdude: verifying flash memory against d:\dev\avr\c\blinky\default\Blinky.hex:
avrdude: load data flash data from input file d:\dev\avr\c\blinky\default\Blinky.hex:
avrdude: input file d:\dev\avr\c\blinky\default\Blinky.hex contains 150 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.26s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x19 != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: lfuse reads as FE
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: lfuse changed! Was e2, and is now fe
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was dc, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: efuse changed! Was 1, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK
avrdude: jtagmkII_close()
avrdude: jtagmkII_close(): Sending sign-off command: 0x80 (1 bytes msg)

avrdude done.  Thank you.
C:\Users\root>avrdude -pm48 -cjtag2isp -Pcom1 -B8 -F -Uflash:r:"c:\temp\Blinky.hex":i -v -v

avrdude: Version 5.6, compiled on Mar  5 2009 at 09:59:30
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "C:\WinAVR-20090313\bin\avrdude.conf"

         Using Port                    : com1
         Using Programmer              : jtag2isp
         Setting bit clk period        : 8.0
avrdude: stk500v2_jtagmkII_open()
avrdude: jtagmkII_getsync(): Sending sign-on command: 0x86 (28 bytes msg)
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              5.44
  hardware version:              0
S_MCU:
  boot-loader FW version:        255
  firmware version:              5.44
  hardware version:              1
Serial number:                   07:00:00:00:0a:21
Device ID:                       JTAGICEmkII
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, zu bytes): 0x80 (1 bytes msg)
avrdude: jtagmkII_getsync(): Sending get sync command: 0x80 (1 bytes msg)
         AVR Part                      : ATMEGA48
         Chip Erase delay              : 45000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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     5     4    0 no        256    4      0  3600  3600 0xff 0xff
           flash         65     6    64    0 yes      4096   64     64  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 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 : JTAGMKII_ISP
         Description     : Atmel JTAG ICE mkII in ISP mode
avrdude: jtagmkII_getparm()
avrdude: jtagmkII_getparm(): Sending get parameter command (parm 0x06): 0x81 (3 bytes msg)
         Vtarget         : 5.1 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.24s

avrdude: Device signature = 0x1e920a
avrdude: Expected signature for ATMEGA48 is 1E 92 05
avrdude: safemode: lfuse reads as E2
avrdude: safemode: hfuse reads as DC
avrdude: safemode: efuse reads as 1
avrdude: reading flash memory:

Reading | ################################################## | 100% 4.49s

avrdude: writing output file "c:\temp\Blinky.hex"

avrdude: safemode: lfuse reads as E2
avrdude: safemode: hfuse reads as DC
avrdude: safemode: efuse reads as 1
avrdude: safemode: Fuses OK
avrdude: jtagmkII_close()
avrdude: jtagmkII_close(): Sending sign-off command: 0x80 (1 bytes msg)

avrdude done.  Thank you.

There's no place like ~/

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

Clarification: the physical order of the 'verbose' output above is chronologically reversed. The actual timeline was:

* Flashed .hex file to Mega48P using AVRDude and Dragon (last example in my first posting from this morning). Verified that the LED was blinking (indicating that the flash definitely succeeded, as opposed to merely appearing to have succeeded)

* Did the verbose 'read' from the Mega48P using AVRDude and the JTAGICE2 (after swapping ISP cables to connect it to the board). This is the second example from my previous post.

* As an afterthought, did the verbose 'write' to the Mega48P using AVRDude and the JTAGICE2 (first example from my previous post).

The .hex file itself was built with AVR Studio, and was flashed to the Mega48p using the JTAGICE2 before everything else (to confirm both that the program worked & blinked the LED, and that the JTAGICE2 worked when used with AVR Studio).

There's no place like ~/

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

I compiled the avr-libc simple demo for an ATmega48, and flashed
it to a device mounted in an STK500. The LED on PB1 flashes as
expected. The detailed debug log (-vvvv) is attached.

Attachment(s): 

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.