Merge pull request #1023 from stefanrueger/issue1004

Fix PICKit2 ATmega2560 flash paged flash read
This commit is contained in:
Stefan Rueger
2022-07-12 14:51:56 +01:00
committed by GitHub

View File

@@ -491,18 +491,15 @@ static int pickit2_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
pgm->pgm_led(pgm, ON); pgm->pgm_led(pgm, ON);
for (addr_base = addr; addr_base < max_addr; ) if (lext) {
{
if ((addr_base == 0 || (addr_base % /*ext_address_boundary*/ 65536) == 0)
&& lext != NULL)
{
memset(cmd, 0, sizeof(cmd)); memset(cmd, 0, sizeof(cmd));
avr_set_bits(lext, cmd); avr_set_bits(lext, cmd);
avr_set_addr(lext, cmd, addr_base); avr_set_addr(lext, cmd, addr/2);
pgm->cmd(pgm, cmd, res); pgm->cmd(pgm, cmd, res);
} }
for (addr_base = addr; addr_base < max_addr; )
{
// bytes to send in the next packet -- not necessary as pickit2_spi() handles breaking up // bytes to send in the next packet -- not necessary as pickit2_spi() handles breaking up
// the data into packets -- but we need to keep transfers frequent so that we can update the // the data into packets -- but we need to keep transfers frequent so that we can update the
// status indicator bar // status indicator bar