diff --git a/ChangeLog b/ChangeLog index b64483df..69ea016a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-11-24 Joerg Wunsch + + * jtag3.c (jtag3_edbg_recv_frame): Better handling for + fragment_info == 0x00 (no response available) + 2021-11-23 Joerg Wunsch * jtag3.c: Use matches() instead of strncmp() diff --git a/jtag3.c b/jtag3.c index 74bc74ad..9d6d5604 100644 --- a/jtag3.c +++ b/jtag3.c @@ -731,6 +731,19 @@ static int jtag3_edbg_recv_frame(PROGRAMMER * pgm, unsigned char **msg) { return -1; } + if (buf[1] == 0) { + // Documentation says: + // "FragmentInfo 0x00 indicates that no response data is + // available, and the rest of the packet is ignored." + avrdude_message(MSG_INFO, + "%s: jtag3_edbg_recv(): " + "No response available\n", + progname); + free(*msg); + free(request); + return -1; + } + /* calculate fragment information */ if (thisfrag == 0) { /* first fragment */