coshx/intel-hex-parser

Wrong outcam

Opened this issue · 0 comments

Outcam bin is wrong. The solution:
Drop 01 (EOF) record.
Do not count finalDataSize, Calculate!

finalDataSize = records[recordIndex - 1].Address + records[recordIndex - 1].DataLength;
outcome = new byte[finalDataSize];
for (int i = 0; i < recordIndex; i++) {
                Record r = records[i];
                for (int j = 0; j < r.DataLength; j++) {
                    outcome[r.Address+j] = r.Data[j];                 
}
}

Your algorithm is wrong when datalength < 16. For example when using #pragma location=0x080002xxx
This is working for me.