Add new component initval to memories in avrdude.conf

... for the factory setting of fuses and lock bits
This commit is contained in:
Stefan Rueger
2023-04-17 01:03:38 +01:00
parent 6c6081ebda
commit fe8b239a64
7 changed files with 8 additions and 2 deletions

View File

@@ -163,6 +163,7 @@
# size = <num> ; # bytes
# page_size = <num> ; # bytes
# num_pages = <num> ; # numeric
# initval = <num> ; # factory setting of fuses and lockbits
# n_word_writes = <num> ; # TPI only: if set, number of words to write
# min_write_delay = <num> ; # micro-seconds
# max_write_delay = <num> ; # micro-seconds

View File

@@ -329,7 +329,8 @@ static char * bittype(int type)
AVRMEM *avr_new_memtype(void) {
AVRMEM *m = (AVRMEM *) cfg_malloc("avr_new_memtype()", sizeof(*m));
m->desc = cache_string("");
m->page_size = 1; // ensure not 0
m->page_size = 1; // Ensure not 0
m->initval = -1; // Unknown value represented as -1
return m;
}

View File

@@ -135,6 +135,7 @@ Component_t avr_comp[] = {
mem_comp_desc(paged, COMP_BOOL),
mem_comp_desc(size, COMP_INT),
mem_comp_desc(num_pages, COMP_INT),
mem_comp_desc(initval, COMP_INT),
mem_comp_desc(n_word_writes, COMP_INT),
mem_comp_desc(offset, COMP_INT),
mem_comp_desc(min_write_delay, COMP_INT),

View File

@@ -803,6 +803,7 @@ static void dev_part_strct(const AVRPART *p, bool tsv, const AVRPART *base, bool
_if_memout(intcmp, m->size > 8192? "0x%x": "%d", size);
_if_memout(intcmp, "%d", page_size);
_if_memout(intcmp, "%d", num_pages);
_if_memout(intcmp, m->initval == -1? "%d": "0x%02x", initval);
_if_memout(intcmp, "%d", n_word_writes);
_if_memout(intcmp, "0x%x", offset);
_if_memout(intcmp, "%d", min_write_delay);

View File

@@ -2200,6 +2200,7 @@ part
size = <num> ; # bytes
page_size = <num> ; # bytes
num_pages = <num> ; # numeric
initval = <num> ; # factory setting of fuses and lockbits
n_word_writes = <num> ; # TPI only: if set, number of words to write
min_write_delay = <num> ; # micro-seconds
max_write_delay = <num> ; # micro-seconds

View File

@@ -129,7 +129,7 @@ SIGN [+-]
chiperasetime | (chiperase|program(fuse|lock))(polltimeout|pulsewidth) | synchcycles | hvspcmdexedelay |
mcu_base | nvm_base | ocd_base | ocdrev |
autobaud_sync | idr | rampz | spmcr | eecr | eind |
paged | size | num_pages | n_word_writes | offset | min_write_delay | max_write_delay | pwroff_after_write |
paged | size | num_pages | initval | n_word_writes | offset | min_write_delay | max_write_delay | pwroff_after_write |
readback_p1 | readback_p2 | mode | delay | blocksize | readsize ) {
/* struct components for PROGRAMMER, AVRPART and AVRMEM */
Component_t *cp = cfg_comp_search(yytext, current_strct);

View File

@@ -325,6 +325,7 @@ typedef struct avrmem {
int size; /* total memory size in bytes */
int page_size; /* size of memory page (if page addressed) */
int num_pages; /* number of pages (if page addressed) */
int initval; /* factory setting of fuses and lock bits */
int n_word_writes; /* TPI only: number words to write at a time */
unsigned int offset; /* offset in IO memory (ATxmega) */
int min_write_delay; /* microseconds */