u8 check;
int i;
+ /* prepare addr */
+ addr+=lpc->roff;
+
/* send cmd */
- send_cmd(lpc->sfd,addr+lpc->roff,len,CMD_WRITE);
+ send_cmd(lpc->sfd,addr,len,CMD_WRITE);
/* transfer data */
cnt=0;
break;
}
if(buf[cnt+i]!=check)
- printf("FATAL: write to flash: wrong transfer\n");
+ printf("FATAL: write to flash (transfer)\n");
}
cksml+=buf[cnt];
cksml+=buf[cnt+1];
if(cksml!=cksmr) {
printf("FATAL: wrong checksum or failure in flash write!\n");
if(cksml+1==cksmr)
- printf(" -> most probably due to flash write!");
+ printf(" -> most probably due to flash write!\n");
else
- printf(" -> most probably due to failure in transfer!");
+ printf(" -> most probably failure in transfer!\n");
+ printf(" addr:0x%08x l:%02x r:%02x\n",addr,cksml,cksmr);
}
return 0;