// last record of .bin file uses sentinel values for address and checksum.
if (!dwRecAddr && !dwRecChk)//2008--1--21 XQH 退出WHILE循环!!!
{
break;
}
// map the record address (FLASH data is cached, for example)
lpDest = OEMMapMemAddr (pCurDownloadFile->dwRegionStart, dwRecAddr);
//2008--9--4 XQH 读数据块/包
// read data block
if (!OEMReadData (dwRecLen, lpDest))//2008--1--17 xqh 通过USB接口将接收到的数据写到映射的地址处,也就NAND FLASH处!!!
{
EdbgOutputDebugString ("****** Data record %d corrupted, ABORT!!! ******\r\n", nPkgNum);
HALT (BLERR_CORRUPTED_DATA);
return (FALSE);
}
if (!VerifyChecksum (dwRecLen, lpDest, dwRecChk))//2008--1--17 XQH 计算每条记录的校验码!!!
{
EdbgOutputDebugString ("****** Checksum failure on record %d, ABORT!!! ******\r\n", nPkgNum);
HALT (BLERR_CHECKSUM);
return (FALSE);
}
// Look for ROMHDR to compute ROM offset. NOTE: romimage guarantees that the record containing
// the TOC signature and pointer will always come before the record that contains the ROMHDR contents.
//
if (dwRecLen == sizeof(ROMHDR) && (*(LPDWORD) OEMMapMemAddr(pCurDownloadFile->dwRegionStart, pCurDownloadFile->dwRegionStart + ROM_SIGNATURE_OFFSET) == ROM_SIGNATURE))
{