mirror of
https://github.com/sharkcz/rkdeveloptool.git
synced 2024-11-22 14:06:47 +01:00
main: fix write_lba fail
the input file of write lba command may not 128 aligned. that may cause write lba command fail. remove the judge to fix this issue. Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
This commit is contained in:
parent
92fb760b97
commit
9908df895e
4
main.cpp
4
main.cpp
@ -682,10 +682,6 @@ bool write_lba(STRUCT_RKDEVICE_DESC &dev, UINT uiBegin, char *szFile)
|
||||
while(iTotalWrite < iFileSize) {
|
||||
memset(pBuf, 0, nSectorSize * DEFAULT_RW_LBA);
|
||||
iWrite = iRead= fread(pBuf, 1, nSectorSize * DEFAULT_RW_LBA, file);
|
||||
if ((int)iRead != nSectorSize * DEFAULT_RW_LBA) {
|
||||
printf("Write LBA failed,err=%d,read=%d,total=%d!\r\n", errno, iRead, nSectorSize * DEFAULT_RW_LBA);
|
||||
goto Exit_WriteLBA;
|
||||
}
|
||||
uiLen = ((iWrite % 512) == 0) ? (iWrite / 512) : (iWrite / 512 + 1);
|
||||
iRet = pComm->RKU_WriteLBA( uiBegin, uiLen, pBuf);
|
||||
if(ERR_SUCCESS == iRet) {
|
||||
|
Loading…
Reference in New Issue
Block a user