How to use FORMAT parameter in avrdude?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
bayviewboom
 
Posts: 6
Joined: Thu May 08, 2014 7:26 pm

How to use FORMAT parameter in avrdude?

Post by bayviewboom »

Hello

Trying to figure out how to use the 'format' parameter with avrdude.

Your example uses 'i' for 'Intel Hex'.

This German site uses 'a' for 'automatic'.

I successfully wrote to an attiny85 from the command-line without ANY 'format' parameter.

This avrdude manual says 'a' means 'automatic', but "for input only". What do they mean by "input?
http://www.cs.ou.edu/~fagg/classes/gene ... vrdude.pdf
(page 8)

I'm using avrdude set up as an external tool in Atmel Studio. Would i use a different 'format' parameter as an external tool in Studio than on the command-line without Studio?

thx!

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: How to use FORMAT parameter in avrdude?

Post by Franklin97355 »

According to this (for version 2.1) http://www.nongnu.org/avrdude/user-manu ... ude_4.html
The filename field indicates the name of the file to read or write. The format field is optional and contains the format of the file to read or write. Possible values are:

i
Intel Hex

s
Motorola S-record

r
raw binary; little-endian byte order, in the case of the flash ROM data

e
ELF (Executable and Linkable Format), the final output file from the linker; currently only accepted as an input file

m
immediate mode; actual byte values specified on the command line, separated by commas or spaces in place of the filename field of the ‘-U’ option. This is useful for programming fuse bytes without having to create a single-byte file or enter terminal mode. If the number specified begins with 0x, it is treated as a hex value. If the number otherwise begins with a leading zero (0) it is treated as octal. Otherwise, the value is treated as decimal.

a
auto detect; valid for input only, and only if the input is not provided at stdin.

d
decimal; this and the following formats are only valid on output. They generate one line of output for the respective memory section, forming a comma-separated list of the values. This can be particularly useful for subsequent processing, like for fuse bit settings.

h
hexadecimal; each value will get the string 0x prepended.

o
octal; each value will get a 0 prepended unless it is less than 8 in which case it gets no prefix.

b
binary; each value will get the string 0b prepended.

The default is to use auto detection for input files, and raw binary format for output files.

Note that if filename contains a colon, the format field is no longer optional since the filename part following the colon would otherwise be misinterpreted as format.

As an abbreviation, the form -U filename is equivalent to specifying -U flash:w:filename:a. This will only work if filename does not have a colon in it.

bayviewboom
 
Posts: 6
Joined: Thu May 08, 2014 7:26 pm

Re: How to use FORMAT parameter in avrdude?

Post by bayviewboom »

hi

yes, as i stated in my OP, i checked the manual and found that "i" means "intel hex" and "a" means "detect automatically".

i'm seeking more insight into what those mean, and when to use them. if you have a chance, check the questions i asked in my OP.

thanks!

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: How to use FORMAT parameter in avrdude?

Post by Franklin97355 »

What do they mean by "input?
Input means the file from which the data is being read.
Intel hex means an input file formatted in the Intel hex format http://www.interlog.com/~speff/usefulinfo/Hexfrmt.pdf
According to the info I posted
The default is to use auto detection for input files, and raw binary format for output files.
Does this answer your questions?

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”