From 269bb7e2a46fcbe90b704539f21d64f8486c1300 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Thu, 19 Apr 2012 13:59:09 +0000 Subject: [PATCH] bug #29019: pagel/bs2 warning when uploading using stk500 to xmega * stk500.c (stk500_initialize): Insert dummy values for PAGEL and BS2 if they are not present in the config file, in order to be able to proceed with the stk500_set_extended_parms() anyway. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1082 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 7 +++++++ NEWS | 1 + stk500.c | 57 +++++++++++++++++++++++++++++-------------------------- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9883568..0a5342a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-04-19 Joerg Wunsch + + bug #29019: pagel/bs2 warning when uploading using stk500 to xmega + * stk500.c (stk500_initialize): Insert dummy values for PAGEL and + BS2 if they are not present in the config file, in order to be able + to proceed with the stk500_set_extended_parms() anyway. + 2012-04-19 Joerg Wunsch * stk500v2_private.h (struct pdata): add boot_start diff --git a/NEWS b/NEWS index 818a3664..67fe1b71 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,7 @@ Current: - bug #30451: Accessing some Xmega memory sections gives not supported error - bug #28744: Can't load bootloader to xmega128a1 + - bug #29019: pagel/bs2 warning when uploading using stk500 to xmega * Keep track of input file contents diff --git a/stk500.c b/stk500.c index 8fb97edf..bf42e088 100644 --- a/stk500.c +++ b/stk500.c @@ -559,37 +559,40 @@ static int stk500_initialize(PROGRAMMER * pgm, AVRPART * p) if (n_extparms) { if ((p->pagel == 0) || (p->bs2 == 0)) { - fprintf(stderr, - "%s: please define PAGEL and BS2 signals in the configuration " - "file for part %s\n", - progname, p->desc); + if (verbose > 1) + fprintf(stderr, + "%s: PAGEL and BS2 signals not defined in the configuration " + "file for part %s, using dummy values\n", + progname, p->desc); + buf[2] = 0xD7; /* they look somehow possible, */ + buf[3] = 0xA0; /* don't they? ;) */ } else { - buf[0] = n_extparms+1; - - /* - * m is currently pointing to eeprom memory if the part has it - */ - if (m) - buf[1] = m->page_size; - else - buf[1] = 0; - buf[2] = p->pagel; buf[3] = p->bs2; - - if (n_extparms == 4) { - if (p->reset_disposition == RESET_DEDICATED) - buf[4] = 0; - else - buf[4] = 1; - } - - rc = stk500_set_extended_parms(pgm, n_extparms+1, buf); - if (rc) { - fprintf(stderr, "%s: stk500_initialize(): failed\n", progname); - exit(1); - } + } + buf[0] = n_extparms+1; + + /* + * m is currently pointing to eeprom memory if the part has it + */ + if (m) + buf[1] = m->page_size; + else + buf[1] = 0; + + + if (n_extparms == 4) { + if (p->reset_disposition == RESET_DEDICATED) + buf[4] = 0; + else + buf[4] = 1; + } + + rc = stk500_set_extended_parms(pgm, n_extparms+1, buf); + if (rc) { + fprintf(stderr, "%s: stk500_initialize(): failed\n", progname); + exit(1); } }