Add autobaud_sync to avrdude.conf part description

This commit is contained in:
Stefan Rueger 2022-11-25 19:20:45 +00:00
parent d2a2ec1d1b
commit 231e88aaf9
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
7 changed files with 77 additions and 58 deletions

View File

@ -130,7 +130,7 @@
# programfusepolltimeout = <num> ;
# programlockpulsewidth = <num> ; # PP only
# programlockpolltimeout = <num> ;
# # JTAG ICE mkII parameters, also from ATDF files
# # debugWIRE and/or JTAG ICE mkII parameters, also from ATDF files
# allowfullpagebitstream = <yes/no> ;
# enablepageprogramming = <yes/no> ;
# idr = <num> ; # IO addr of IDR (OCD) reg
@ -143,6 +143,8 @@
# ocdrev = <num> ;
# pgm_enable = <instruction format> ;
# chip_erase = <instruction format> ;
# # parameters for bootloaders
# autobaud_sync = <num> ; # autobaud detection byte, default 0x30
#
# memory <memtype>
# paged = <yes/no> ; # yes/no (flash only, do not use for EEPROM)
@ -175,12 +177,13 @@
#
# If any of the above parameters are not specified, the default value
# of 0 is used for numerics (except for mcuid, hvupdi_variant and
# ocdrev, where the default value is -1) or the empty string "" for
# string values. If a required parameter is left empty, AVRDUDE will
# complain. Almost all occurrences of numbers (with the exception of
# pin numbers and where they are separated by space, eg, in signature
# and readback) can also be given as simple expressions involving
# arithemtic and bitwise operators.
# ocdrev, where the default value is -1, and for autobaud_sync which
# defaults to 0x30), or the empty string "" for string values. If a
# required parameter is left empty, AVRDUDE will complain. Almost all
# occurrences of numbers (with the exception of pin numbers and where
# they are separated by space, eg, in signature and readback) can also
# be given as simple expressions involving arithemtic and bitwise
# operators.
#
# Parts can also inherit parameters from previously defined parts
# using the following syntax. In this case specified integer and
@ -12011,6 +12014,7 @@ part
n_boot_sections = 1;
mcu_base = 0x0090;
nvm_base = 0x01c0;
autobaud_sync = 0x20;
memory "fuse1"
size = 1;
@ -16329,6 +16333,7 @@ part parent "m88"
id = "lgt8f88p";
mcuid = 227;
signature = 0x1e 0x93 0x0f;
autobaud_sync = 0x1c;
;
#------------------------------------------------------------
@ -16340,6 +16345,7 @@ part parent "m168"
id = "lgt8f168p";
mcuid = 228;
signature = 0x1e 0x94 0x0b;
autobaud_sync = 0x1c;
;
#------------------------------------------------------------
@ -16351,4 +16357,5 @@ part parent "m328"
id = "lgt8f328p";
mcuid = 229;
signature = 0x1e 0x95 0x0f;
autobaud_sync = 0x1c;
;

View File

@ -578,6 +578,7 @@ AVRPART *avr_new_part(void) {
// Default values
p->mcuid = -1;
p->hvupdi_variant = -1;
p->autobaud_sync = 0x30; // STK_GET_SYNC
memset(p->signature, 0xFF, 3);
p->reset_disposition = RESET_DEDICATED;
p->retry_pulse = PIN_AVR_SCK;

View File

@ -72,6 +72,7 @@ Component_t avr_comp[] = {
part_comp_desc(n_page_erase, COMP_INT),
part_comp_desc(n_boot_sections, COMP_INT),
part_comp_desc(boot_section_size, COMP_INT),
part_comp_desc(autobaud_sync, COMP_CHAR),
// AVRMEM
mem_comp_desc(n_word_writes, COMP_INT),

View File

@ -716,6 +716,7 @@ static void dev_part_strct(const AVRPART *p, bool tsv, const AVRPART *base, bool
_if_partout(intcmp, "0x%04x", nvm_base);
_if_partout(intcmp, "0x%04x", ocd_base);
_if_partout(intcmp, "%d", ocdrev);
_if_partout(intcmp, "0x%02x", autobaud_sync);
for(int i=0; i < AVR_OP_MAX; i++)
if(!base || opcodecmp(p->op[i], base->op[i], i))

View File

@ -1925,7 +1925,7 @@ part
programfusepolltimeout = <num> ;
programlockpulsewidth = <num> ; # PP only
programlockpolltimeout = <num> ;
# JTAG ICE mkII parameters, also from ATDF files
# debugWIRE and/or JTAG ICE mkII parameters, also from ATDF files
allowfullpagebitstream = <yes/no> ;
enablepageprogramming = <yes/no> ;
idr = <num> ; # IO addr of IDR (OCD) reg
@ -1938,6 +1938,8 @@ part
ocdrev = <num> ;
pgm_enable = <instruction format> ;
chip_erase = <instruction format> ;
# parameters for bootloaders
autobaud_sync = <num> ; # autobaud detection byte, default 0x30
memory <memtype>
paged = <yes/no> ; # yes/no (flash only, do not use for EEPROM)
@ -1970,14 +1972,14 @@ part
@end smallexample
@noindent
If any of the above parameters are not specified, the default value
of 0 is used for numerics (except for @code{mcuid}, @code{hvupdi_variant} and @code{ocdrev},
where the default value is -1) or the empty string @code{""} for string
values. If a required parameter is left empty, AVRDUDE will complain.
Almost all occurrences of numbers (with the exception of pin numbers
and where they are separated by space, eg, in signature and readback)
can also be given as simple expressions involving arithemtic and
bitwise operators.
If any of the above parameters are not specified, the default value of 0
is used for numerics (except for @code{mcuid}, @code{hvupdi_variant} and
@code{ocdrev}, where the default value is -1, and for @code{autobaud_sync}
which defaults to 0x30) or the empty string @code{""} for string values.
If a required parameter is left empty, AVRDUDE will complain. Almost all
occurrences of numbers (with the exception of pin numbers and where they
are separated by space, eg, in signature and readback) can also be given
as simple expressions involving arithemtic and bitwise operators.
@menu
* Parent Part::

View File

@ -122,7 +122,7 @@ SIGN [+-]
(?x: prog_modes | mcuid | n_interrupts | n_page_erase | n_word_writes | n_boot_sections |
boot_section_size ) { /* Components for assignment */
boot_section_size | autobaud_sync) { /* Components for assignment */
Component_t *cp = cfg_comp_search(yytext, current_strct);
if(!cp) {

View File

@ -252,56 +252,63 @@ typedef struct avrpart {
this pin (PIN_AVR_*) */
unsigned flags; /* see AVRPART_ masks */
int timeout; /* stk500 v2 xml file parameter */
int stabdelay; /* stk500 v2 xml file parameter */
int cmdexedelay; /* stk500 v2 xml file parameter */
int synchloops; /* stk500 v2 xml file parameter */
int bytedelay; /* stk500 v2 xml file parameter */
int pollindex; /* stk500 v2 xml file parameter */
unsigned char pollvalue; /* stk500 v2 xml file parameter */
int predelay; /* stk500 v2 xml file parameter */
int postdelay; /* stk500 v2 xml file parameter */
int pollmethod; /* stk500 v2 xml file parameter */
/* STK500 v2 parameters from ATDF files */
int timeout;
int stabdelay;
int cmdexedelay;
int synchloops;
int bytedelay;
int pollindex;
unsigned char pollvalue;
int predelay;
int postdelay;
int pollmethod;
enum ctl_stack_t ctl_stack_type; /* what to use the ctl stack for */
unsigned char controlstack[CTL_STACK_SIZE]; /* stk500v2 PP/HVSP ctl stack */
unsigned char flash_instr[FLASH_INSTR_SIZE]; /* flash instructions (debugWire, JTAG) */
unsigned char eeprom_instr[EEPROM_INSTR_SIZE]; /* EEPROM instructions (debugWire, JTAG) */
int hventerstabdelay; /* stk500 v2 hv mode parameter */
int progmodedelay; /* stk500 v2 hv mode parameter */
int latchcycles; /* stk500 v2 hv mode parameter */
int togglevtg; /* stk500 v2 hv mode parameter */
int poweroffdelay; /* stk500 v2 hv mode parameter */
int resetdelayms; /* stk500 v2 hv mode parameter */
int resetdelayus; /* stk500 v2 hv mode parameter */
int hvleavestabdelay; /* stk500 v2 hv mode parameter */
int resetdelay; /* stk500 v2 hv mode parameter */
int chiperasepulsewidth; /* stk500 v2 hv mode parameter */
int chiperasepolltimeout; /* stk500 v2 hv mode parameter */
int chiperasetime; /* stk500 v2 hv mode parameter */
int programfusepulsewidth; /* stk500 v2 hv mode parameter */
int programfusepolltimeout; /* stk500 v2 hv mode parameter */
int programlockpulsewidth; /* stk500 v2 hv mode parameter */
int programlockpolltimeout; /* stk500 v2 hv mode parameter */
int synchcycles; /* stk500 v2 hv mode parameter */
int hvspcmdexedelay; /* stk500 v2 hv mode file parameter */
/* STK500 v2 hv mode parameters */
int hventerstabdelay;
int progmodedelay;
int latchcycles;
int togglevtg;
int poweroffdelay;
int resetdelayms;
int resetdelayus;
int hvleavestabdelay;
int resetdelay;
int chiperasepulsewidth;
int chiperasepolltimeout;
int chiperasetime;
int programfusepulsewidth;
int programfusepolltimeout;
int programlockpulsewidth;
int programlockpolltimeout;
int synchcycles;
int hvspcmdexedelay;
unsigned char idr; /* JTAG ICE mkII XML file parameter */
unsigned char rampz; /* JTAG ICE mkII XML file parameter */
unsigned char spmcr; /* JTAG ICE mkII XML file parameter */
unsigned char eecr; /* JTAC ICE mkII XML file parameter */
unsigned int mcu_base; /* Base address of MCU control block in ATxmega devices */
unsigned int nvm_base; /* Base address of NVM controller in ATxmega devices */
unsigned int ocd_base; /* Base address of OCD module in AVR8X/UPDI devices */
int ocdrev; /* OCD revision (JTAGICE3 parameter, from AS6 XML files) */
OPCODE * op[AVR_OP_MAX]; /* opcodes */
/* debugWIRE and/or JTAG ICE mkII XML file parameters */
unsigned char idr; /* I/O address of IDR (OCD) reg */
unsigned char rampz; /* I/O address of RAMPZ reg */
unsigned char spmcr; /* memory address of SPMCR reg */
unsigned char eecr; /* memory address of EECR reg */
unsigned int mcu_base; /* Base address of MCU control block in ATxmega devices */
unsigned int nvm_base; /* Base address of NVM controller in ATxmega devices */
unsigned int ocd_base; /* Base address of OCD module in AVR8X/UPDI devices */
int ocdrev; /* OCD revision (JTAGICE3 parameter, from AS6 XML files) */
LISTID mem; /* avr memory definitions */
LISTID mem_alias; /* memory alias definitions */
const char * config_file; /* config file where defined */
int lineno; /* config file line number */
/* Bootloader paramater */
unsigned char autobaud_sync; /* Sync byte for bootloader autobaud, must be <= 0x30 */
OPCODE * op[AVR_OP_MAX]; /* opcodes */
LISTID mem; /* avr memory definitions */
LISTID mem_alias; /* memory alias definitions */
const char * config_file; /* config file where defined */
int lineno; /* config file line number */
} AVRPART;
typedef struct avrmem {