Skip to content

Commit

Permalink
make sure the bitstream is ended with 0xFFFFFFFFF or progfpga would c…
Browse files Browse the repository at this point in the history
…rash.

The bin file generated by ISE 14.7 (Ubuntu 18.04) doesn't end with 0xFFFFFFFF.
  • Loading branch information
joeyjyliu committed May 29, 2019
1 parent 5bbfdff commit da7cee0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions patch_progfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ int main(int argc, char **argv)
}
break;
}

if( Adr == PatchData[BurnType].ImageSize / 4 - 1 && Value != 0xFFFFFFFF ) {
printf( "overrided end of bitstream file with 0xFFFFFFFF\n" );

Value = 0xFFFFFFFF;
Adr = 0xFFFFFFFF;
}

// Reverse the byte order
cp1[0] = cp[3];
cp1[1] = cp[2];
Expand Down

0 comments on commit da7cee0

Please sign in to comment.