From 9599bf224319790af46531d9dc8d5356218c7e77 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Tue, 22 Nov 2022 20:44:12 +0000 Subject: [PATCH] Add n_boot_sections and boot_section_size to part definitions --- src/config.c | 2 ++ src/developer_opts.c | 4 +++- src/doc/avrdude.texi | 2 ++ src/lexer.l | 4 +++- src/libavrdude.h | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index a0cf35cf..ba31ceee 100644 --- a/src/config.c +++ b/src/config.c @@ -70,6 +70,8 @@ Component_t avr_comp[] = { part_comp_desc(mcuid, COMP_INT), part_comp_desc(n_interrupts, COMP_INT), part_comp_desc(n_page_erase, COMP_INT), + part_comp_desc(n_boot_sections, COMP_INT), + part_comp_desc(boot_section_size, COMP_INT), // AVRMEM mem_comp_desc(n_word_writes, COMP_INT), diff --git a/src/developer_opts.c b/src/developer_opts.c index b6fd722e..5f25b654 100644 --- a/src/developer_opts.c +++ b/src/developer_opts.c @@ -615,7 +615,7 @@ static void dev_part_strct(const AVRPART *p, bool tsv, const AVRPART *base, bool dev_print_comment(cp->comms); if(p->parent_id && *p->parent_id) - dev_info("part parent %s\n", p->parent_id); + dev_info("part parent \"%s\"\n", p->parent_id); else dev_info("part\n"); } @@ -627,6 +627,8 @@ static void dev_part_strct(const AVRPART *p, bool tsv, const AVRPART *base, bool _if_partout(intcmp, "%d", mcuid); _if_partout(intcmp, "%d", n_interrupts); _if_partout(intcmp, "%d", n_page_erase); + _if_partout(intcmp, "%d", n_boot_sections); + _if_partout(intcmp, "%d", boot_section_size); _if_partout(intcmp, "%d", hvupdi_variant); _if_partout(intcmp, "0x%02x", stk500_devcode); _if_partout(intcmp, "0x%02x", avr910_devcode); diff --git a/src/doc/avrdude.texi b/src/doc/avrdude.texi index 672c7a98..007c7cd4 100644 --- a/src/doc/avrdude.texi +++ b/src/doc/avrdude.texi @@ -1866,6 +1866,8 @@ part mcuid = ; # unique id in 0..2039 for 8-bit AVRs n_interrupts = ; # number of interrupts, used for vector bootloaders n_page_erase = ; # if set, number of pages erased during SPM erase + n_boot_sections = ; # Number of boot sections + boot_section_size = ; # Size of (smallest) boot section, if any hvupdi_variant = ; # numeric -1 (n/a) or 0..2 devicecode = ; # deprecated, use stk500_devcode stk500_devcode = ; # numeric diff --git a/src/lexer.l b/src/lexer.l index b637c4b7..ecff08aa 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -121,7 +121,9 @@ SIGN [+-] } -prog_modes|mcuid|n_interrupts|n_page_erase|n_word_writes { /* Components for assignment */ +(?x: prog_modes | mcuid | n_interrupts | n_page_erase | n_word_writes | n_boot_sections | + boot_section_size ) { /* Components for assignment */ + Component_t *cp = cfg_comp_search(yytext, current_strct); if(!cp) { yyerror("Unknown component %s in %s", yytext, cfg_strct_name(current_strct)); diff --git a/src/libavrdude.h b/src/libavrdude.h index 83556af3..2652a363 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -237,6 +237,8 @@ typedef struct avrpart { int mcuid; /* Unique id in 0..2039 for urclock programmer */ int n_interrupts; /* Number of interrupts, used for vector bootloaders */ int n_page_erase; /* If set, number of pages erased during NVM erase */ + int n_boot_sections; /* Number of boot sections */ + int boot_section_size; /* Size of (smallest) boot section, if any */ int hvupdi_variant; /* HV pulse on UPDI pin, no pin or RESET pin */ int stk500_devcode; /* stk500 device code */ int avr910_devcode; /* avr910 device code */