Submitted by Martin Thierer:
patch #10017: uspasp / tpi: Automatically clear configuration byte (fuse) before writing it * usbasp.c (usbasp_tpi_paged_write): clear fuse region before writing it git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1468 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
62a00cedc7
commit
91948428a6
|
@ -1,3 +1,9 @@
|
|||
2021-11-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Martin Thierer:
|
||||
patch #10017: uspasp / tpi: Automatically clear configuration byte (fuse) before writing it
|
||||
* usbasp.c (usbasp_tpi_paged_write): clear fuse region before writing it
|
||||
|
||||
2021-11-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Michael Petersen:
|
||||
|
|
1
NEWS
1
NEWS
|
@ -102,6 +102,7 @@ Current:
|
|||
patch #9744: Patch for ATMega324A support
|
||||
patch #10000: Add support for extended UPDI device context
|
||||
patch #9697: Add iseavrprog support
|
||||
patch #10017: uspasp / tpi: Automatically clear configuration byte (fuse) before writing it
|
||||
|
||||
* Internals:
|
||||
- New avrdude.conf keyword "family_id", used to verify SIB attributes
|
||||
|
|
18
usbasp.c
18
usbasp.c
|
@ -1156,6 +1156,24 @@ static int usbasp_tpi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
pr = addr + m->offset;
|
||||
writed = 0;
|
||||
|
||||
/* must erase fuse first */
|
||||
if(strcmp(m->desc, "fuse") == 0)
|
||||
{
|
||||
/* Set PR */
|
||||
usbasp_tpi_send_byte(pgm, TPI_OP_SSTPR(0));
|
||||
usbasp_tpi_send_byte(pgm, (pr & 0xFF) | 1 );
|
||||
usbasp_tpi_send_byte(pgm, TPI_OP_SSTPR(1));
|
||||
usbasp_tpi_send_byte(pgm, (pr >> 8) );
|
||||
/* select SECTION_ERASE */
|
||||
usbasp_tpi_send_byte(pgm, TPI_OP_SOUT(NVMCMD));
|
||||
usbasp_tpi_send_byte(pgm, NVMCMD_SECTION_ERASE);
|
||||
/* dummy write */
|
||||
usbasp_tpi_send_byte(pgm, TPI_OP_SST_INC);
|
||||
usbasp_tpi_send_byte(pgm, 0x00);
|
||||
|
||||
usbasp_tpi_nvm_waitbusy(pgm);
|
||||
}
|
||||
|
||||
/* Set PR to flash */
|
||||
usbasp_tpi_send_byte(pgm, TPI_OP_SSTPR(0));
|
||||
usbasp_tpi_send_byte(pgm, (pr & 0xFF) | 1 );
|
||||
|
|
Loading…
Reference in New Issue