avrdude reads 261930==0x3ff2a of 0x40000==262144 bytes

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

Here is the command line:

​avrdude -p m2560 -c atmelice -P usb \
        -U flash:r:flash.bin:r -U flash:r:flash.hex:i

with results:

$ grep -vn ':20' flash.hex
2049::020000040001F9
4098::020000040002F8
6147::020000040003F7
8189::0AFF200000000000000000000000D7
8190::00000001FF
/c/Users/hennebry/Documents/projects/msi-lava-pc-util
$ ls -l flash.bin
-rw-r--r-- 1 hennebry Administrators 261930 Jun 15 14:29 flash.bin

Line 8189 suggests that avrdude only downloaded the first 0x3ff2a bytes.

 

What is going on?

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

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

Why not use obcopy to convert the .hex back to .bin and it'll show exactly how many bytes were read. Or perhaps even easier, run avr-size on the .hex

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

clawson wrote:
Why not use obcopy to convert the .hex back to .bin and it'll show exactly how many bytes were read. Or perhaps even easier, run avr-size on the .hex
I can read the hex. It corresponds to the binary: (8190-5)*32+10=261930 bytes.

The last byte shown is at 0x3FF29.

 

My problem is not that I do know how many byte avrdude read.

My problem is that the number makes no sense.

Why read 0x3FF2a out of 0x40000?

What do I do about it?

I need the rest of those bytes.

 

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

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

AS7 with a dragon got me all the bytes.

Could not get AS7 to notice the atmelice.

-rw-r--r-- 1 hennebry Administrators 262144 Jun 17 16:17 wtf.bin
...
$ cmp fl*.bin wtf.bin
cmp: EOF on flash.bin

Still do not know the problem with avrdude and atmelice.

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

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

The rest of the bytes turned out to be 0xFF's.

My suspicion is that avrdude quietly does not save trailing 0xFF's.

Do not know for sure.

The poke at it and see what it does method is a real pain.

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

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

skeeve wrote:
Do not know for sure.
I'm pretty sure it says that for definite somewhere. Either in the manual, the release notes or the source.

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

The documentation does not even specify any correlation between what is read and what is written.

https://www.nongnu.org/avrdude/u... wrote:
The op field specifies what operation to perform:

r

read the specified device memory and write to the specified file

Had I been hunting through the source instead of for a workaround,

I might still be at it.

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
$ man avrdude
.
.
.
           -U memtype:op:filename[:format]
                   Perform a memory operation as indicated.  The memtype field
                   specifies the memory type to operate on.  The available
                   memory types are device-dependent, the actual configuration
                   can be viewed with the part command in terminal mode.  Typ‐
                   ically, a device's memory configuration at least contains
                   the memory types flash and eeprom.  All memory types cur‐
                   rently known are:
.
.
.
                   The op field specifies what operation to perform:

                   r        read device memory and write to the specified file
.
.
.
                   When reading any kind of flash memory area (including the
                   various sub-areas in Xmega devices), the resulting output
                   file will be truncated to not contain trailing 0xFF bytes
                   which indicate unprogrammed (erased) memory.  Thus, if the
                   entire memory is unprogrammed, this will result in an out‐
                   put file that has no contents at all.

 

"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."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

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

"Fast.  Cheap.  Good.  Pick two."

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

 

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

Thanks.

Hadn't even known avrdude had a man page.

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles

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

Not just man page but it's been in the manual since this:

 

http://svn.savannah.gnu.org/view...

 

(April 2015)

 

Complete details of change:

 

http://svn.savannah.gnu.org/view...

 

(interesting that the text has to be entered in two places - suggests the "man" generation is separate from the "pdf" generation)

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

I did search.  All I found was what I quoted or similar.

"Demons after money.
Whatever happened to the still beating heart of a virgin?
No one has any standards anymore." -- Giles