NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Avrdude -U Flag and File Formats

May 18, 2011
by Mindale
Mindale's Avatar

I am trying to understand the makefile a little better and I am wondering about the -U flag for Avrdude. Specifically, the flag in the standard makefile is:

-U flash:w:your_program.hex:a

It is my understanding that the :a component signifies the format of the file being written, but what is this format specifically? What does the :a stand for?

Thanks for your help.

May 19, 2011
by Rick_S
Rick_S's Avatar

From the avrdude documentation pdf: (Which is a good read if you want to know more about avrdude)

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
m immediate mode; actual byte values specified on the command line,
  seperated by commas or spaces in place of the filename field of the
  ‘-i’, ‘-o’, or ‘-U’ options. 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.

so 'a' auto detects the type.


May 19, 2011
by Mindale
Mindale's Avatar

Thanks for the info and the link. This documentation is really helpful.

Post a Reply

Please log in to post a reply.

Did you know that you can control multiple LEDs from one microcontroller output? Learn more...