[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avrdude-dev] Strange behaviour when using butterfly protocol
From: |
Сизюхин Алексей |
Subject: |
[avrdude-dev] Strange behaviour when using butterfly protocol |
Date: |
Tue, 06 Dec 2016 11:51:03 +0300 |
Found some problem using butterfly protocol (avr109, avr911 or other
serial bootloader variants).
When i try to write to flash with
avrdude -c butterfly -p x128a4u -b 115200 -P /dev/ttyS3 -U
flash:w:lic-950.hex
I get not obvious repeating error.
***failed;
Â
As I can see from sources this message appears on avr_write_byte()
failed in avr.c
For butterfly protocol butterfly_write_byte() is called inside
avr_write_byte() as pgm->write_byte().
Â
Inside butterfly_write_byte() we can see this code:
Â
   if ((cmd[3] = toupper((int)(m->desc[0]))) == 'E') {   /*
write to eeprom */
     cmd[2] = 1;
     cmd[4] = value;
     size = 5;
   } else {                  /* write to
flash */
     /* @@@ not yet implemented */
     cmd[2] = 2;
     size = 6;
     avrdude_message(MSG_INFO, "%s:Write to flash not
implemented", __FUNCTION__);
    avrdude_message(MSG_INFO, "\n");
     return -1;
   }
Seems like write to flash is not implemented.
But when i call avrdude with -e key i can program whole firmware.
Â
This can be bug because actually writing to flash is implemented
because i can write with erase key (-e).
OR this can be built-in protection from writing without erasing. In
this case replacing repeating "***failed;" error with some "Can't write
without erase" will be more appropriate.
Â
Â
Â
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avrdude-dev] Strange behaviour when using butterfly protocol,
Сизюхин Алексей <=