diff --git a/src/avrdude.conf.in b/src/avrdude.conf.in index ba7f4f8e..2fc59ecd 100644 --- a/src/avrdude.conf.in +++ b/src/avrdude.conf.in @@ -17114,13 +17114,15 @@ part # AVR8X tiny family common values #------------------------------------------------------------ -part parent ".avr8x" - id = ".avr8x_tiny"; - desc = "AVR8X tiny family common values"; - family_id = "tinyAVR"; +part parent ".avr8x" + id = ".avr8x_tiny"; + desc = "AVR8X tiny family common values"; + family_id = "tinyAVR"; + # Shared UPDI pin, HV on UPDI pin + hvupdi_variant = 0; memory "userrow" - size = 0x20; + size = 0x20; offset = 0x1300; page_size = 0x20; readsize = 0x100; @@ -17135,13 +17137,15 @@ part parent ".avr8x" # AVR8X mega family common values #------------------------------------------------------------ -part parent ".avr8x" - id = ".avr8x_mega"; - desc = "AVR8X mega family common values"; - family_id = "megaAVR"; +part parent ".avr8x" + id = ".avr8x_mega"; + desc = "AVR8X mega family common values"; + family_id = "megaAVR"; + # Dedicated UPDI pin, no HV + hvupdi_variant = 1; memory "userrow" - size = 0x40; + size = 0x40; offset = 0x1300; page_size = 0x40; readsize = 0x100; @@ -18240,11 +18244,13 @@ part parent ".avr8x_mega" #------------------------------------------------------------ part - id = ".avrdx"; - desc = "AVR-Dx family common values"; - has_updi = yes; - nvm_base = 0x1000; - ocd_base = 0x0F80; + id = ".avrdx"; + desc = "AVR-Dx family common values"; + has_updi = yes; + nvm_base = 0x1000; + ocd_base = 0x0F80; + # Dedicated UPDI pin, no HV + hvupdi_variant = 1; memory "signature" size = 3; @@ -19210,9 +19216,11 @@ part parent ".avrdx" # AVR-Ex family common values #------------------------------------------------------------ -part parent ".avrdx" - id = ".avrex"; - desc = "AVR-Ex family common values"; +part parent ".avrdx" + id = ".avrex"; + desc = "AVR-Ex family common values"; + # Shared UPDI pin, HV on _RESET + hvupdi_variant = 2; memory "userrow" size = 0x40; diff --git a/src/config_gram.y b/src/config_gram.y index a8416162..126b9b54 100644 --- a/src/config_gram.y +++ b/src/config_gram.y @@ -81,6 +81,7 @@ static int pin_name; %token K_DEFAULT_SERIAL %token K_DESC %token K_FAMILY_ID +%token K_HVUPDI_VARIANT %token K_DEVICECODE %token K_STK500_DEVCODE %token K_AVR910_DEVCODE @@ -676,6 +677,12 @@ part_parm : free_token($3); } | + K_HVUPDI_VARIANT TKN_EQUAL TKN_NUMBER + { + current_part->hvupdi_variant = $3->value.number; + free_token($3); + } | + K_DEVICECODE TKN_EQUAL TKN_NUMBER { { yyerror("devicecode is deprecated, use " diff --git a/src/lexer.l b/src/lexer.l index 0b31eb21..dd5c081a 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -159,6 +159,7 @@ hventerstabdelay { yylval=NULL; return K_HVENTERSTABDELAY; } hvleavestabdelay { yylval=NULL; return K_HVLEAVESTABDELAY; } hvsp_controlstack { yylval=NULL; return K_HVSP_CONTROLSTACK; } hvspcmdexedelay { yylval=NULL; return K_HVSPCMDEXEDELAY; } +hvupdi_variant { yylval=NULL; return K_HVUPDI_VARIANT; } id { yylval=NULL; return K_ID; } idr { yylval=NULL; return K_IDR; } io { yylval=new_token(K_IO); return K_IO; } diff --git a/src/libavrdude.h b/src/libavrdude.h index ddb72b48..2b87ddf1 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -202,6 +202,7 @@ typedef struct avrpart { char desc[AVR_DESCLEN]; /* long part name */ char id[AVR_IDLEN]; /* short part name */ char family_id[AVR_FAMILYIDLEN+1]; /* family id in the SIB (avr8x) */ + int hvupdi_variant; /* 12V pulse on UPDI pin, no pin or RESET pin */ int stk500_devcode; /* stk500 device code */ int avr910_devcode; /* avr910 device code */ int chip_erase_delay; /* microseconds */