projects
/
my-code
/
arm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
flashing works, sample betty fw announcing itself :)
[my-code/arm.git]
/
betty
/
lpcload.c
diff --git
a/betty/lpcload.c
b/betty/lpcload.c
index
9f60d88
..
d1bfd54
100644
(file)
--- a/
betty/lpcload.c
+++ b/
betty/lpcload.c
@@
-564,8
+564,11
@@
int write_to_flash(t_lpc *lpc,u8 *buf,u32 addr,int len) {
u8 check;
int i;
u8 check;
int i;
+ /* prepare addr */
+ addr+=lpc->roff;
+
/* send cmd */
/* send cmd */
- send_cmd(lpc->sfd,addr
+lpc->roff
,len,CMD_WRITE);
+ send_cmd(lpc->sfd,addr,len,CMD_WRITE);
/* transfer data */
cnt=0;
/* transfer data */
cnt=0;
@@
-591,7
+594,7
@@
int write_to_flash(t_lpc *lpc,u8 *buf,u32 addr,int len) {
break;
}
if(buf[cnt+i]!=check)
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];
}
cksml+=buf[cnt];
cksml+=buf[cnt+1];
@@
-611,9
+614,10
@@
int write_to_flash(t_lpc *lpc,u8 *buf,u32 addr,int len) {
if(cksml!=cksmr) {
printf("FATAL: wrong checksum or failure in flash write!\n");
if(cksml+1==cksmr)
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
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;
}
return 0;