bank 0x00 upload working with crc

This commit is contained in:
David Voswinkel
2009-06-29 21:48:24 +02:00
parent 2ebd2b75aa
commit 77d9418cee
8 changed files with 34 additions and 26 deletions

View File

@@ -27,6 +27,7 @@ uint16_t do_crc(uint8_t * data, uint16_t size)
uint16_t i;
for (i = 0; i < size; i++) {
crc = crc_xmodem_update(crc, data[i]);
}
return crc;
}
@@ -41,15 +42,18 @@ uint16_t do_crc_update(uint16_t crc, uint8_t * data, uint16_t size)
}
void crc_check_bulk_memory(uint32_t bottom_addr,uint32_t top_addr)
uint16_t crc_check_bulk_memory(uint32_t bottom_addr,uint32_t top_addr)
{
uint16_t crc = 0;
uint32_t addr = 0;
uint8_t req_bank = 0;
sram_bulk_read_start(bottom_addr);
printf("crc_check_bulk_memory: bottom_addr=0x%08lx top_addr=0x%08lx\n",
bottom_addr, top_addr);
for (addr = bottom_addr; addr < top_addr; addr++) {
if (addr && addr % 0x8000 == 0) {
printf("crc_check_bulk: bank=0x%02x addr=0x%08lx crc=0x%04x\n",
printf("crc_check_bulk_memory: bank=0x%02x addr=0x%08lx crc=0x%04x\n",
req_bank,addr,crc);
req_bank++;
crc = 0;
@@ -57,11 +61,11 @@ void crc_check_bulk_memory(uint32_t bottom_addr,uint32_t top_addr)
crc = crc_xmodem_update(crc, sram_bulk_read());
sram_bulk_read_next();
}
sram_bulk_read_end();
if (addr % 0x8000 == 0)
printf("crc_check_bulk: bank=0x%02x addr=0x%08lx crc=0x%04x\n",
printf("crc_check_bulk_memory: bank=0x%02x addr=0x%08lx crc=0x%04x\n",
req_bank,addr,crc);
sram_bulk_read_end();
return crc;
}