bug in avreal 1.28r2 and 1.28r3

A strange bug was found in avreal 1.28r2 and 1.28r3. At the coincidence of conditions

  • An FT2232/FT4232-based adapter is used
  • There are some data for top two flash bytes — either data from hex-file or erase counter
  • flash and fuses are used in one avreal call
  • -v verification switch is used

for some microcontroller types avreal fails with “synchronosation lost” error after the first verification.

If -n switch is used then code writing fails

Writing erase counter = 125
Programming CODE memory
 done (7.9ms)
Verifying CODE memory

	% Verifying from 0x1FFFE to 0x1FFFF   passed
 done (2.83ms)
Programming CODE memory

Synchronisation lost
Reset pin released

If -n switch is not used fuse programming fails

	% Verifying from 0x1E000 to 0x1EFFF  ........
	% Verifying from 0x1F000 to 0x1FFFF  ........ passed
 done (3.2s)
Programming fuses
	% Write Fuses	command AC A8 00 EB,  reply 00 87 31 03

Synchronisation lost
Reset pin released

If top two flash bytes are not used then verification and programming work fine.

	% Verifying from 0x1E000 to 0x1EFFF  ........
	% Verifying from 0x1F000 to 0x1FFFD  ....... passed
 done (3.2s)
Programming fuses
	% Write Fuses	command AC A8 00 EB,  reply 00 AC A8 00
	% Write Fuses	command AC E0 00 F3,  reply EB AC E0 00

It is known that the bug affects ATmega128 programming and does not touch ATmega8, ATmega168, atmga328P, ATmega64, ATmega325, ATmega2561.
The bug can be avoided by splitting code and fuse programming into two steps or by using LPT-based adapter.


The bug has been fixed in version 1.28r5.

 


Another bug — for some AVRs avreal 1.28r3 writes fuses properly

Programming fuses
    % Write Fuses    command AC A0 00 E7,  reply 00 AC A0 00
    % Write Fuses    command AC A8 00 F9,  reply E7 AC A8 00
    % Write Fuses    command AC A4 00 FC,  reply F9 AC A4 00
    % Read Fuses    command 50 00 00 00,  reply FC 50 00 E7
    % Read Fuses    command 58 00 00 00,  reply 00 58 00 FF
    % Read Fuses    command 58 08 00 00,  reply 00 58 08 D9
    % Read Fuses    command 50 08 00 00,  reply 00 50 08 FC

But at verification stage avreal uses invalid data and reports “Verifying of fuses failed”.


Thus, it is recommended to use 1.28r2 or if updates from 1.28r1 are not essential — version 1.28r1.

I am sorry.


The bug has been fixed in version 1.28r4.

Leave a Reply

[flagcounter image]