Add new jtagmkii_updi programmer type option

in order to resolve issue #1037
This commit is contained in:
MCUdude 2022-07-26 11:30:53 +02:00
parent c81f52ff10
commit 104dcf6052
4 changed files with 39 additions and 3 deletions

View File

@ -1734,7 +1734,7 @@ programmer
programmer
id = "jtag2updi";
desc = "JTAGv2 to UPDI bridge";
type = "jtagmkii_pdi";
type = "jtagmkii_updi";
connection_type = serial;
baudrate = 115200;
;

View File

@ -1306,9 +1306,9 @@ static int jtagmkII_initialize(PROGRAMMER * pgm, AVRPART * p)
const char *ifname;
/* Abort and print error if programmer does not support the target microcontroller */
if ((strncmp(ldata(lfirst(pgm->id)), "jtag2updi", strlen("jtag2updi")) == 0 && p->flags & AVRPART_HAS_PDI) ||
if ((strncmp(pgm->type, "JTAGMKII_UPDI", strlen("JTAGMKII_UPDI")) == 0 && p->flags & AVRPART_HAS_PDI) ||
(strncmp(ldata(lfirst(pgm->id)), "jtagmkII", strlen("jtagmkII")) == 0 && p->flags & AVRPART_HAS_UPDI)) {
avrdude_message(MSG_INFO, "Error: programmer %s does not support target %s\n\n",
avrdude_message(MSG_INFO, "ERROR: programmer %s does not support target %s\n\n",
ldata(lfirst(pgm->id)), p->desc);
return -1;
}
@ -3929,6 +3929,39 @@ void jtagmkII_pdi_initpgm(PROGRAMMER * pgm)
pgm->flag = PGM_FL_IS_PDI;
}
const char jtagmkII_updi_desc[] = "Atmel JTAG ICE mkII in UPDI mode";
void jtagmkII_updi_initpgm(PROGRAMMER * pgm)
{
strcpy(pgm->type, "JTAGMKII_UPDI");
/*
* mandatory functions
*/
pgm->initialize = jtagmkII_initialize;
pgm->display = jtagmkII_display;
pgm->enable = jtagmkII_enable;
pgm->disable = jtagmkII_disable;
pgm->program_enable = jtagmkII_program_enable_INFO;
pgm->chip_erase = jtagmkII_chip_erase;
pgm->open = jtagmkII_open_pdi;
pgm->close = jtagmkII_close;
pgm->read_byte = jtagmkII_read_byte;
pgm->write_byte = jtagmkII_write_byte;
/*
* optional functions
*/
pgm->paged_write = jtagmkII_paged_write;
pgm->paged_load = jtagmkII_paged_load;
pgm->page_erase = jtagmkII_page_erase;
pgm->print_parms = jtagmkII_print_parms;
pgm->setup = jtagmkII_setup;
pgm->teardown = jtagmkII_teardown;
pgm->page_size = 256;
pgm->flag = PGM_FL_IS_PDI;
}
const char jtagmkII_dragon_desc[] = "Atmel AVR Dragon in JTAG mode";
void jtagmkII_dragon_initpgm(PROGRAMMER * pgm)

View File

@ -36,6 +36,7 @@ extern const char jtagmkII_desc[];
extern const char jtagmkII_avr32_desc[];
extern const char jtagmkII_dw_desc[];
extern const char jtagmkII_pdi_desc[];
extern const char jtagmkII_updi_desc[];
extern const char jtagmkII_dragon_desc[];
extern const char jtagmkII_dragon_dw_desc[];
extern const char jtagmkII_dragon_pdi_desc[];
@ -43,6 +44,7 @@ void jtagmkII_initpgm (PROGRAMMER * pgm);
void jtagmkII_avr32_initpgm (PROGRAMMER * pgm);
void jtagmkII_dw_initpgm (PROGRAMMER * pgm);
void jtagmkII_pdi_initpgm (PROGRAMMER * pgm);
void jtagmkII_updi_initpgm (PROGRAMMER * pgm);
void jtagmkII_dragon_initpgm (PROGRAMMER * pgm);
void jtagmkII_dragon_dw_initpgm (PROGRAMMER * pgm);
void jtagmkII_dragon_pdi_initpgm (PROGRAMMER * pgm);

View File

@ -80,6 +80,7 @@ const PROGRAMMER_TYPE programmers_types[] = {
{"jtagmkii_dw", jtagmkII_dw_initpgm, jtagmkII_dw_desc},
{"jtagmkii_isp", stk500v2_jtagmkII_initpgm, stk500v2_jtagmkII_desc},
{"jtagmkii_pdi", jtagmkII_pdi_initpgm, jtagmkII_pdi_desc},
{"jtagmkii_updi", jtagmkII_updi_initpgm, jtagmkII_updi_desc},
{"jtagice3", jtag3_initpgm, jtag3_desc},
{"jtagice3_pdi", jtag3_pdi_initpgm, jtag3_pdi_desc},
{"jtagice3_updi", jtag3_updi_initpgm, jtag3_updi_desc},