avrdude-dev
[Top][All Lists]
Advanced

[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.

   Â

   Â

   Â


reply via email to

[Prev in Thread] Current Thread [Next in Thread]