From 8132abbf71fa26997ed6aad13487169686a99633 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Fri, 2 Aug 2024 14:11:49 +0100 Subject: [PATCH] Fix byte writes to TPI lockbits for jpag3.c --- src/jtag3.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jtag3.c b/src/jtag3.c index e9c48a04..9a20a709 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -3038,10 +3038,12 @@ static int jtag3_write_byte_tpi(const PROGRAMMER *pgm, const AVRPART *p, const A return -1; } - status = jtag3_erase_tpi(pgm, p, mem, addr); - if (status < 0) { - pmsg_error("error in communication, received status 0x%02x\n", status); - return -1; + if (mem_is_a_fuse(mem) || mem_is_flash(mem)) { + status = jtag3_erase_tpi(pgm, p, mem, addr); + if (status < 0) { + pmsg_error("error in communication, received status 0x%02x\n", status); + return -1; + } } paddr = mem->offset + addr;