avrfuse AVR fuse manipulation tool
avrfuse < --read | --write | --default > -p partno [ --start regex ] [ --end regex ] [ --prefix string ] [ --iconf filename ] [ --oconf filename ] [ --conf filename ] [ --dry ] [ --short ] [ avrdude-options ]
avrfuse is a wrapper around avrdude that converts fuse byte settings into a human readable configuration file. The configuration file may be a standalone fuse file or part of a source file. avrfuse can modify fuse configuration files in place, can read and write differently named files or read/write from/to stdio.
--read read fuse values from the device; process iconf and replace its settings with the ones read from the device and write oconf --write write fuse values to the device; process iconf to load desired fuse settings and burn them in device --default produce a new fuse config file overwriting oconf. Values are device specific defaults. Useful for creating initial fuse config file. -p partno specify device to work with --start regex embedded fuse configuration: config starts after the line matching regex. --end regex embedded fuse configuration: config ends at the line matching regex. --prefix string embedded fuse configuration: each line of the configuration shall be prefixed with string. Lines not prefixed are not part of the configuration (and kept intact). --iconf filename read existing configuration from filename. Empty or - means stdin. --oconf filename write new configuration to filename. Empty or - means stdout. --conf filename set both iconf and oconf to filename --dry dry run; with --write, do not actually write the device (no effect in other modes) --short shorten comments when creating configuration with --default. More (up to 3) --short options will get even shorter output. --verbose Increase how verbose status report is generated on stderr. More --verbose parameters increases verbosity even more. avrdude-options other arguments are passed on to avrdude
While processing a config, configuration lines starting with # and empty configuration lines are kept intact on the output. Order of lines will be the same on output as on input. Missing input settings will be assumed to have the device-specific default and will not be added on output either (but such use is discouraged).
There are multiple options supporting use of embedded fuse configuration:
use case howto singe block, between explicit markers use --start and --end with markers multiple blocks, between explicit markers use --start and --end with markers; file may contain multiple start/end markers single block, at the beginning of the file use --end with marker; in the file place marker at the end of the fuse configuration single block, at the end of the file use --start with marker; in the file place marker at the end of content, before fuse configuartion any of the above, combined with --prefix useful if the syntax of the source requires per-line marking of the comment (for example "#" for shell, ";" for asm) using only --prefix following the language-specific comment sequence, prefix shall contain an unique sequence (i.e. prefix should be "#fuse#" or ";fuse;")
In any of the above cases, lines that are not considered part of the fuse configuration (out of --start/--end blocks and/or don't have the proper prefix) will be echoed back intact, in order, on the output.