Add more trace output, by now only to the TPI functions.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1190 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2013-09-01 20:48:17 +00:00
parent 453761106e
commit 2ca1323540
2 changed files with 33 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-09-01 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* usbasp.c: Add more trace output, by now only for the TPI
functions.
2013-08-31 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* usbasp.c (usbasp_transmit): Add -vvvv trace output.

View File

@ -928,14 +928,24 @@ static int usbasp_tpi_nvm_waitbusy(PROGRAMMER * pgm)
{
int retry;
if (verbose > 2)
fprintf(stderr, "%s: usbasp_tpi_nvm_waitbusy() ...", progname);
for(retry=50; retry>0; retry--)
{
usbasp_tpi_send_byte(pgm, TPI_OP_SIN(NVMCSR));
if(usbasp_tpi_recv_byte(pgm) & NVMCSR_BSY)
continue;
if (verbose > 2)
fprintf(stderr, " ready\n");
return 0;
}
if (verbose > 2)
fprintf(stderr, " failure\n");
return -1;
}
@ -949,7 +959,9 @@ static int usbasp_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p)
{
int retry;
if (verbose > 2)
fprintf(stderr, "%s: usbasp_tpi_program_enable()\n", progname);
/* change guard time */
usbasp_tpi_send_byte(pgm, TPI_OP_SSTCS(TPIPCR));
usbasp_tpi_send_byte(pgm, TPIPCR_GT_2b);
@ -987,6 +999,9 @@ static int usbasp_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p)
static int usbasp_tpi_chip_erase(PROGRAMMER * pgm, AVRPART * p)
{
if (verbose > 2)
fprintf(stderr, "%s: usbasp_tpi_chip_erase()\n", progname);
/* Set PR to flash */
usbasp_tpi_send_byte(pgm, TPI_OP_SSTPR(0));
usbasp_tpi_send_byte(pgm, 0x01);
@ -1016,6 +1031,10 @@ static int usbasp_tpi_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
uint16_t pr;
if (verbose > 2)
fprintf(stderr, "%s: usbasp_tpi_paged_load(\"%s\", 0x%0x, %d)\n",
progname, m->desc, addr, n_bytes);
dptr = m->buf;
pr = addr + m->offset;
readed = 0;
@ -1057,6 +1076,10 @@ static int usbasp_tpi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
uint16_t pr;
if (verbose > 2)
fprintf(stderr, "%s: usbasp_tpi_paged_write(\"%s\", 0x%0x, %d)\n",
progname, m->desc, addr, n_bytes);
sptr = m->buf;
pr = addr + m->offset;
writed = 0;
@ -1135,6 +1158,10 @@ static int usbasp_tpi_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsig
uint16_t pr;
if (verbose > 2)
fprintf(stderr, "%s: usbasp_tpi_read_byte(\"%s\", 0x%0lx)\n",
progname, m->desc, addr);
pr = m->offset + addr;
/* READBLOCK */