Merge pull request #1351 from stefanrueger/option-n

Document -n behaviour wrt -U and terminal
This commit is contained in:
Stefan Rueger
2023-05-04 19:20:08 +01:00
committed by GitHub
3 changed files with 24 additions and 11 deletions

View File

@@ -586,9 +586,10 @@ written to
.Va stderr
anyway.
.It Fl n
No-write - disables actually writing data to the MCU (useful for debugging
No-write: disables writing data to the MCU whilst processing -U
(useful for debugging
.Nm avrdude
).
). The terminal mode continues to write to the device.
.It Fl O
Perform a RC oscillator run-time calibration according to Atmel
application note AVR053.
@@ -844,14 +845,18 @@ More
.Fl v
options increase verbosity level.
.It Fl V
Disable automatic verify check when uploading data.
Disable automatic verify check when uploading data with -U.
.It Fl x Ar extended_param
Pass
.Ar extended_param
to the chosen programmer implementation as an extended parameter.
The interpretation of the extended parameter depends on the
programmer itself.
See below for a list of programmers accepting extended parameters.
See below for a list of programmers accepting extended parameters
or issue
.Nm
-x help ... to see the extended options of the chosen programmer.
.El
.Ss Terminal mode
In this mode,

View File

@@ -667,8 +667,8 @@ Note that initial diagnostic messages (during option parsing) are still
written to @var{stderr} anyway.
@item -n
No-write - disables actually writing data to the MCU (useful for
debugging AVRDUDE).
No-write: disables writing data to the MCU whilst processing -U (useful for
debugging AVRDUDE). The terminal mode continues to write to the device.
@item -O
Perform a RC oscillator run-time calibration according to Atmel
@@ -904,13 +904,14 @@ Enable verbose output.
More @code{-v} options increase verbosity level.
@item -V
Disable automatic verify check when uploading data.
Disable automatic verify check when uploading data with @code{-U}.
@item -x @var{extended_param}
Pass @var{extended_param} to the chosen programmer implementation as
an extended parameter. The interpretation of the extended parameter
depends on the programmer itself. See below for a list of programmers
accepting extended parameters.
accepting extended parameters or issue @code{avrdude -x help ...} to
see the extended options of the chosen programmer.
@end table

View File

@@ -124,6 +124,8 @@ int avrdude_message2(FILE *fp, int lno, const char *file, const char *func, int
// Reduce effective verbosity level by number of -q above one when printing to stderr
if ((quell_progress < 2 || fp != stderr? verbose: verbose+1-quell_progress) >= msglvl) {
if(msgmode & MSG2_PROGNAME) {
if(!bols[bi].bol)
fprintf(fp, "\n");
fprintf(fp, "%s", progname);
if(verbose >= MSG_NOTICE && (msgmode & MSG2_FUNCTION))
fprintf(fp, " %s()", func);
@@ -241,8 +243,8 @@ static void usage(void)
" Memory operation specification\n"
" Multiple -U options are allowed, each request\n"
" is performed in the order specified\n"
" -n Do not write anything to the device\n"
" -V Do not verify\n"
" -n Do not write to the device whilst processing -U\n"
" -V Do not automatically verify during -U\n"
" -t Enter terminal mode\n"
" -E <exitspec>[,<exitspec>] List programmer exit specifications\n"
" -x <extended_param> Pass <extended_param> to programmer, see -xhelp\n"
@@ -511,6 +513,7 @@ int main(int argc, char * argv [])
const char *exitspecs; /* exit specs string from command line */
const char *programmer; /* programmer id */
int explicit_c; /* 1=explicit -c on command line, 0=not spcified there */
int explicit_e; /* 1=explicit -e on command line, 0=not spcified there */
char sys_config[PATH_MAX]; /* system wide config file */
char usr_config[PATH_MAX]; /* per-user config file */
char executable_abspath[PATH_MAX]; /* absolute path to avrdude executable */
@@ -602,6 +605,7 @@ int main(int argc, char * argv [])
pgm = NULL;
programmer = "";
explicit_c = 0;
explicit_e = 0;
verbose = 0;
baudrate = 0;
bitclock = 0.0;
@@ -718,6 +722,7 @@ int main(int argc, char * argv [])
case 'e': /* perform a chip erase */
erase = 1;
explicit_e = 1;
uflags &= ~UF_AUTO_ERASE;
break;
@@ -1454,7 +1459,7 @@ int main(int argc, char * argv [])
* before the chip can accept new programming
*/
if (uflags & UF_NOWRITE) {
pmsg_warning("conflicting -e and -n options specified, NOT erasing chip\n");
pmsg_warning("%s-n specified, NOT erasing chip\n", explicit_e? "conflicting -e and ": "");
} else {
pmsg_info("erasing chip\n");
exitrc = avr_chip_erase(pgm, p);
@@ -1471,6 +1476,8 @@ int main(int argc, char * argv [])
/*
* terminal mode
*/
if (uflags & UF_NOWRITE)
pmsg_warning("the terminal ignores option -n, that is, it writes to the device\n");
exitrc = terminal_mode(pgm, p);
}