Provide programmer arduino_as_isp

This commit is contained in:
Stefan Rueger
2023-06-06 14:53:01 +01:00
parent ca6cf7f8c5
commit 9267f9435d
2 changed files with 18 additions and 2 deletions

View File

@@ -1339,6 +1339,21 @@ programmer
connection_type = serial;
;
#------------------------------------------------------------
# arduino_as_isp
#------------------------------------------------------------
# Not to be confused with arduinoISP, this is the same as `-c stk500v1`
# but treats EEPROM r/w correctly for arduino_as_isp programmers
programmer
id = "arduino_as_isp";
desc = "Arduino board as programmer using arduino as ISP firmware";
type = "stk500";
prog_modes = PM_ISP;
connection_type = serial;
;
#------------------------------------------------------------
# mib510
#------------------------------------------------------------

View File

@@ -966,8 +966,9 @@ static int set_memtype_a_div(const PROGRAMMER *pgm, const AVRPART *p, const AVRM
if(avr_mem_is_eeprom_type(m)) {
*memtypep = 'E';
// Word addr for bootloaders where part is a "classic" part (eg, optiboot, arduinoisp, ...), byte addr otherwise
*a_divp = (pgm->prog_modes & PM_SPM) && !(p->prog_modes & (PM_UPDI | PM_PDI))? 2: 1;
// Word addr for bootloaders or Arduino as ISP if part is a "classic" part, byte addr otherwise
*a_divp = ((pgm->prog_modes & PM_SPM) || str_caseeq(ldata(lfirst(pgm->id)), "arduino_as_isp")) \
&& !(p->prog_modes & (PM_UPDI | PM_PDI))? 2: 1;
return 0;
}