[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [bug #51320] 0x00 written as 0xFF when byte count is less

From: Andrzej Pietrasiewicz
Subject: [avrdude-dev] [bug #51320] 0x00 written as 0xFF when byte count is less than 0x10
Date: Wed, 31 Jul 2019 16:24:24 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #7, bug #51320 (project avrdude):

I have a solution - if an ihex record has odd length then mark the missing
high byte as allocated and let it contain 0xff:

diff --git a/fileio.c b/fileio.c
index 02c50ab..e3c82a4 100644
--- a/fileio.c
+++ b/fileio.c
@@ -334,6 +334,10 @@ static int ihex2b(char * infile, FILE * inf,
           mem->buf[nextaddr+i] = ihex.data[i];
           mem->tags[nextaddr+i] = TAG_ALLOCATED;
+       if (ihex.reclen & 0x1) {
+          mem->buf[nextaddr+i] = 0xff;
+          mem->tags[nextaddr+i] = TAG_ALLOCATED;
+       }
         if (nextaddr+ihex.reclen > maxaddr)
           maxaddr = nextaddr+ihex.reclen;

But why is the record length odd in the first place if flash locations are
2-byte locations?


Reply to this item at:


  Message sent via Savannah

reply via email to

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