From 7da6ccc52eab0f82dd83c33650ed25ccda240a0b Mon Sep 17 00:00:00 2001 From: Hans Date: Wed, 27 May 2026 06:56:28 +0200 Subject: [PATCH] Add support for the AVR-LA chip family (#2105) --- src/avr.c | 3 + src/avrdude.conf.in | 333 +++++++++++++++++++++++++++++++++++++++++++ src/doc/avrdude.texi | 7 +- src/libavrdude.h | 3 +- 4 files changed, 344 insertions(+), 2 deletions(-) diff --git a/src/avr.c b/src/avr.c index 8f7a0e2b..fb5ea07c 100644 --- a/src/avr.c +++ b/src/avr.c @@ -1594,8 +1594,11 @@ Memtable avr_mem_order[100] = { {"bodcfg", MEM_FUSE1 | MEM_IS_A_FUSE}, {"fuse2", MEM_FUSE2 | MEM_IS_A_FUSE}, {"osccfg", MEM_FUSE2 | MEM_IS_A_FUSE}, + {"fuse3", MEM_FUSE3 | MEM_IS_A_FUSE}, + {"pincfg", MEM_FUSE3 | MEM_IS_A_FUSE}, {"fuse4", MEM_FUSE4 | MEM_IS_A_FUSE}, {"tcd0cfg", MEM_FUSE4 | MEM_IS_A_FUSE}, + {"hwmoncfg", MEM_FUSE4 | MEM_IS_A_FUSE}, {"fuse5", MEM_FUSE5 | MEM_IS_A_FUSE}, {"syscfg0", MEM_FUSE5 | MEM_IS_A_FUSE}, {"fuse6", MEM_FUSE6 | MEM_IS_A_FUSE}, diff --git a/src/avrdude.conf.in b/src/avrdude.conf.in index 9f978f92..28e76e25 100644 --- a/src/avrdude.conf.in +++ b/src/avrdude.conf.in @@ -24533,6 +24533,339 @@ part parent "16eb32" # 32eb32 ; ; +#------------------------------------------------------------ +# AVR-Lx family common values +#------------------------------------------------------------ + +part # .avr-lx + desc = "AVR-Lx family common values"; + id = ".avr-lx"; + family_id = "AVR "; + prog_modes = PM_SPM | PM_UPDI; + n_boot_sections = 1; + boot_section_size = 256; + # Shared UPDI pin, HV on _RESET + hvupdi_variant = 2; + nvm_base = 0x1000; + ocd_base = 0x0f80; + syscfg_base = 0x0f00; + factory_fcpu = 20000000; + + memory "fuses" + size = 16; + offset = 0x1050; + readsize = 1; + ; + + memory "fuse0" + size = 1; + initval = 0x00; + offset = 0x1050; + readsize = 1; + ; + + memory "wdtcfg" + alias "fuse0"; + ; + + memory "fuse1" + size = 1; + initval = 0x00; + offset = 0x1051; + readsize = 1; + ; + + memory "bodcfg" + alias "fuse1"; + ; + + memory "fuse2" + size = 1; + initval = 0x00; + bitmask = 0x08; + offset = 0x1052; + readsize = 1; + ; + + memory "osccfg" + alias "fuse2"; + ; + + memory "fuse3" + size = 1; + initval = 0x02; + bitmask = 0x03; + offset = 0x1053; + readsize = 1; + ; + + memory "pincfg" + alias "fuse3"; + ; + + memory "fuse4" + size = 1; + initval = 0x00; + bitmask = 0x01; + offset = 0x1054; + readsize = 1; + ; + + memory "hwmoncfg" + alias "fuse4"; + ; + + memory "fuse5" + size = 1; + initval = 0x00; + bitmask = 0xc3; + offset = 0x1055; + readsize = 1; + ; + + memory "syscfg0" + alias "fuse5"; + ; + + memory "fuse6" + size = 1; + initval = 0x07; + bitmask = 0x07; + offset = 0x1056; + readsize = 1; + ; + + memory "syscfg1" + alias "fuse6"; + ; + + memory "fuse7" + size = 1; + initval = 0x00; + offset = 0x1057; + readsize = 1; + ; + + memory "codesize" + alias "fuse7"; + ; + + memory "append" + alias "fuse7"; + ; + + memory "fuse8" + size = 1; + initval = 0x00; + offset = 0x1058; + readsize = 1; + ; + + memory "bootsize" + alias "fuse8"; + ; + + memory "bootend" + alias "fuse8"; + ; + + memory "fusea" + size = 2; + initval = 0x03; + bitmask = 0xfff3; + offset = 0x105a; + readsize = 1; + ; + + memory "pdicfg" + alias "fusea"; + ; + + memory "lock" + size = 4; + initval = 0x5cc5c55c; + offset = 0x1040; + readsize = 4; + ; + + memory "prodsig" + size = 128; + page_size = 128; + offset = 0x1080; + readsize = 128; + ; + + memory "sigrow" + alias "prodsig"; + ; + + memory "signature" + size = 3; + offset = 0x1080; + readsize = 3; + ; + + memory "tempsense" + size = 4; + offset = 0x1084; + readsize = 1; + ; + + memory "sernum" + size = 16; + offset = 0x1090; + readsize = 1; + ; + + memory "userrow" + size = 64; + page_size = 64; + offset = 0x1200; + readsize = 64; + ; + + memory "usersig" + alias "userrow"; + ; + + memory "io" + size = 4160; + readsize = 1; + ; + + memory "sib" + size = 32; + readsize = 1; + ; +; + +#------------------------------------------------------------ +# AVR16LA14 +#------------------------------------------------------------ + +part parent ".avr-lx" # 16la14 + desc = "AVR16LA14"; + id = "16la14"; + variants = + "AVR16LA14-SOIC/TSSOP: DIP14, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 414; + signature = 0x1e 0x95 0x54; + + memory "eeprom" + size = 512; + page_size = 8; + offset = 0x1400; + readsize = 256; + ; + + memory "flash" + size = 0x4000; + page_size = 64; + offset = 0x800000; + readsize = 256; + ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; +; + +#------------------------------------------------------------ +# AVR16LA20 +#------------------------------------------------------------ + +part parent "16la14" # 16la20 + desc = "AVR16LA20"; + id = "16la20"; + variants = + "AVR16LA20-SOIC/TSSOP: DIP20, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 415; + signature = 0x1e 0x95 0x53; +; + +#------------------------------------------------------------ +# AVR16LA28 +#------------------------------------------------------------ + +part parent "16la14" # 16la28 + desc = "AVR16LA28"; + id = "16la28"; + variants = + "AVR16LA28-SSOP/SPDIP: DIP28, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 416; + signature = 0x1e 0x95 0x52; +; + +#------------------------------------------------------------ +# AVR16LA32 +#------------------------------------------------------------ + +part parent "16la14" # 16la32 + desc = "AVR16LA32"; + id = "16la32"; + variants = + "AVR16LA32-VQFN/TQFP: QFP32, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 417; + signature = 0x1e 0x95 0x51; +; + +#------------------------------------------------------------ +# AVR32LA14 +#------------------------------------------------------------ + +part parent "16la14" # 32la14 + desc = "AVR32LA14"; + id = "32la14"; + variants = + "AVR32LA14-SOIC/TSSOP: DIP14, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 418; + signature = 0x1e 0x95 0x29; + + memory "flash" + size = 0x8000; + ; +; + +#------------------------------------------------------------ +# AVR32LA20 +#------------------------------------------------------------ + +part parent "32la14" # 32la20 + desc = "AVR32LA20"; + id = "32la20"; + variants = + "AVR32LA20-SOIC/TSSOP: DIP20, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 419; + signature = 0x1e 0x95 0x60; +; + +#------------------------------------------------------------ +# AVR32LA28 +#------------------------------------------------------------ + +part parent "32la14" # 32la28 + desc = "AVR32LA28"; + id = "32la28"; + variants = + "AVR32LA28-SSOP/SPDIP: DIP28, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 420; + signature = 0x1e 0x95 0x59; +; + +#------------------------------------------------------------ +# AVR32LA32 +#------------------------------------------------------------ + +part parent "32la14" # 32la32 + desc = "AVR32LA32"; + id = "32la32"; + variants = + "AVR32LA32-VQFN/TQFP: QFP32, Fmax=20 MHz, T=[-40 C, 125 C], Vcc=[1.8 V, 5.5 V]"; + mcuid = 421; + signature = 0x1e 0x95 0x58; +; + #------------------------------------------------------------ # AVR-Sx family common values #------------------------------------------------------------ diff --git a/src/doc/avrdude.texi b/src/doc/avrdude.texi index e3fb2fe6..452b3fd4 100644 --- a/src/doc/avrdude.texi +++ b/src/doc/avrdude.texi @@ -5915,10 +5915,15 @@ A.k.a. @code{wdtcfg}: watchdog configuration A.k.a. @code{bodcfg}: brownout detection configuration @cindex @code{osccfg} @item fuse2 +A.k.a. @code{pincfg}: (not all devices): UPDI and reset pin configuration +@cindex @code{pincfg} +@item fuse3 A.k.a. @code{osccfg}: oscillator configuration @cindex @code{tcd0cfg} +@cindex @code{hwmoncfg} @item fuse4 -A.k.a. @code{tcd0cfg} (not all devices): timer counter type D configuration +A.k.a. @code{tcd0cfg} (not all devices): timer counter type D configuration@* +A.k.a. @code{hwmoncfg} (not all devices): CPU safety function checks for illegal opcodes @cindex @code{syscfg0} @item fuse5 A.k.a. @code{syscfg0}: system configuration 0 diff --git a/src/libavrdude.h b/src/libavrdude.h index 85d67fb5..1e7293c8 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -423,7 +423,8 @@ typedef struct { #define MEM_FUSE0 0 // fuse lfuse fuse0 wdtcfg #define MEM_FUSE1 1 // hfuse fuse1 bodcfg #define MEM_FUSE2 2 // efuse fuse2 osccfg -#define MEM_FUSE4 4 // fuse4 tcd0cfg +#define MEM_FUSE3 3 // fuse3 pincfg +#define MEM_FUSE4 4 // fuse4 tcd0cfg hwmoncfg #define MEM_FUSE5 5 // fuse5 syscfg0 #define MEM_FUSE6 6 // fuse6 syscfg1 #define MEM_FUSE7 7 // fuse7 append codesize