Browse Source

fix address command

For flash the 'A'ddress command sends word offset instead of byte offset.
related to avrdude bug #38951: AVR109 use byte offset instead of word offset
master
Olaf Rempel 4 years ago
parent
commit
0521de7655
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      main.c

+ 7
- 2
main.c View File

@@ -502,7 +502,7 @@ int main(void)
if (val == 'a') {
response = 'Y';

/* write address */
/* write address: flash:words, eeprom:bytes */
} else if (val == 'A') {
address = (recvchar() << 8);
address |= recvchar();
@@ -528,8 +528,11 @@ int main(void)
*data++ = (count < size) ? recvchar() : 0xFF;
}

if ((val == 'F') && (address < BOOTLOADER_START)) {

if ((val == 'F') && (address < (BOOTLOADER_START >> 1))) {
address <<= 1;
writeFlashPage(size);
address >>= 1;
response = '\r';

} else if ((val == 'E') && (address < E2END)) {
@@ -549,7 +552,9 @@ int main(void)
val = recvchar();

if (val == 'F') {
address <<= 1;
readSendFlashPage(size);
address >>= 1;

} else if (val == 'E') {
readSendEEpromPage(size);


Loading…
Cancel
Save