[ 1938476 ] Address is not displayed when verify

* src/flash/flash.c (flashmem): Show the address when verifying.
     Show the end address when program and verify complete.


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1164 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Jie Zhang 17 years ago
parent a7eef74cdd
commit 301e6fffd7

@ -1,3 +1,8 @@
2008-04-10 Jie Zhang <jie.zhang@analog.com>
* src/flash/flash.c (flashmem): Show the address when verifying.
Show the end address when program and verify complete.
2008-04-10 Jie Zhang <jie.zhang@analog.com>
From Stefan Pledl <stefan.pledl@mesutronic.de>

@ -312,7 +312,7 @@ flashmem( bus_t *bus, FILE *f, uint32_t addr )
adr += flash_driver->bus_width;
}
}
printf( "\n" );
printf( _("addr: 0x%08X\n"), adr - flash_driver->bus_width);
flash_driver->readarray( cfi_array );
@ -321,37 +321,36 @@ flashmem( bus_t *bus, FILE *f, uint32_t addr )
fflush( stdout );
adr = addr;
while (!feof( f )) {
uint8_t buf[16];
uint32_t data;
uint32_t readed;
int j;
uint32_t data, readed;
uint8_t b[BSIZE];
int bc = 0, bn = 0, btr = BSIZE;
if (fread( buf, flash_driver->bus_width, 1, f ) != 1) {
if (feof(f))
break;
printf( _("Error during file read.\n") );
return;
}
bn = fread( b, 1, btr, f );
data = 0;
for (j = 0; j < flash_driver->bus_width; j++)
if (big_endian)
data = (data << 8) | buf[j];
else
data |= buf[j] << (j * 8);
for (bc = 0; bc < bn; bc += flash_driver->bus_width) {
int j;
if ((adr & 0xFF) == 0) {
printf( _("addr: 0x%08X\r"), adr );
fflush( stdout );
}
if ((addr && 0xffffff00) == 0) {
printf( _("addr: 0x%08X\r"), adr );
fflush( stdout );
}
readed = bus_read( bus, adr );
if (data != readed) {
printf( _("\nverify error:\nread: 0x%08X\nexpected: 0x%08X\n"), readed, data );
return;
data = 0;
for (j = 0; j < flash_driver->bus_width; j++)
if (big_endian)
data = (data << 8) | b[bc + j];
else
data |= b[bc + j] << (j * 8);
readed = bus_read( bus, adr );
if (data != readed) {
printf( _("addr: 0x%08X\n"), adr );
printf( _("verify error:\nread: 0x%08X\nexpected: 0x%08X\n"), readed, data );
return;
}
adr += flash_driver->bus_width;
}
adr += flash_driver->bus_width;
}
printf( _("\nDone.\n") );
printf( _("addr: 0x%08X\nDone.\n"), adr - flash_driver->bus_width);
free( erased );
}

Loading…
Cancel
Save