Skip to content

Commit

Permalink
Fix array indexing in Condense()
Browse files Browse the repository at this point in the history
This fixes intermittent flash verify failures. The wrong array index was
used to accumulate the list of blocks that need to be programmed after
erase, leaving flash corrupted.
  • Loading branch information
Caveh Jalali committed Feb 9, 2022
1 parent bf9a2f4 commit af1db20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion project.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ size_t Condense(uintptr_t* out, unsigned char* vc, uintptr_t* addrs, size_t addr
for (j = 0; j < addrSize; j++) {
for (i = addrs[j] - baseAddr; i < (addrs[j] - baseAddr + step); i++) {
if (vc[i] != 0xFF) {
out[j] = addrs[j];
out[outSize] = addrs[j];
outSize++;
break;
}
Expand Down

0 comments on commit af1db20

Please sign in to comment.