avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] avrdude flash size less than device capacity?


From: Cunningham, Robert
Subject: [avr-chat] avrdude flash size less than device capacity?
Date: Wed, 18 Sep 2013 17:00:50 +0000

We’ve been a PIC-only house for decades, but are starting to use AVR parts for some new projects.  I’m comparing the available AVR tool chains and IDEs, and am using an Arudino with a 328p as my guinea pig.

 

When comparing the flash tool in Atmel Studio 6.1 to avrdude, I noticed that the first would download the full 32K of flash (32768 bytes), while avrdude downloaded 18 byte less (32750 bytes).  I had both tools create Intel hex files, and I used avr-size to get the amount of data in each.

 

The avrdude command used was:  avrdude –p atmega328p –c avrispmkii –P usb –U flash:r:theflash.hex:i

 

I didn’t find any reason for the size discrepancy in the avrdude documentation.

 

1.       Why is avrdude doing this?

2.       Is there a way to force avrdude to do a full 32K download?

 

Since the two hex files generated used different line lengths, I passed each through “avr-objcopy –I ihex –O ihex” to get them to the same line length.  A run through avr-size still reports the same size for each.  A diff yielded the following:

 

$ diff atmelstudio.hex avrdude.hex

2047,2048c2047

< :107FE000182FDFDF1150E9F7F4DF1F910895FFFF2D

< :107FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91

---

> :0E7FE000182FDFDF1150E9F7F4DF1F9108952D

 

When I used avrdude interactively (-t) and entered “dump flash 0 32768”, the full 32k was displayed, with the last two lines shown below.

 

7fe0  18 2f df df 11 50 e9 f7  f4 df 1f 91 08 95 ff ff  |./...P..........|

7ff0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

 

This means both dumps contain equivalent data, except for the last 18 bytes that contain FF.  Why does avrdude not save these bytes via “-U” but does show them in an interactive dump?  Are they non-programmable or reserved or something?  The part’s datasheet and Google are not telling me anything useful...

 

Help?  (Feel free to apply a clue-by-four as appropriate.  Use small words.)

 

 

Thanks,

 

-BobC

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]