From cc9a44bee2152e887691958d3580e17ef15810e2 Mon Sep 17 00:00:00 2001 From: hackbard Date: Thu, 30 Aug 2007 17:12:18 +0200 Subject: [PATCH 1/1] parsinf 05 records now too, still strabge bootloader returns to the go cmd! --- betty/lpcload.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/betty/lpcload.c b/betty/lpcload.c index 6c167e2..30a808e 100644 --- a/betty/lpcload.c +++ b/betty/lpcload.c @@ -60,6 +60,7 @@ typedef struct s_lpc { u8 info; /* info/mode */ char freq[8]; /* frequency */ u32 roff; /* ram offset of uc */ + u32 jaddr; /* addr for the jump */ } t_lpc; void usage(void) { @@ -311,7 +312,7 @@ int go(t_lpc *lpc) { char buf[BUFSIZE]; int ret,len; - snprintf(buf,BUFSIZE,"G %d A\r\n",lpc->roff); + snprintf(buf,BUFSIZE,"G %d A\r\n",lpc->jaddr); len=strlen(buf); ret=txrx(lpc,buf,len,TXRX_TYPE_GO); @@ -476,6 +477,10 @@ int firmware_to_ram(t_lpc *lpc) { case 0x04: lpc->roff=((buf[0]<<24)|(buf[1]<<16)); break; + case 0x05: + lpc->jaddr=((buf[0]<<24)|(buf[1]<<16)); + lpc->jaddr|=((buf[2]<<8)|buf[3]); + break; default: printf("fw to ram: unknown type %02x\n",type); return -1; @@ -498,6 +503,7 @@ int main(int argc,char **argv) { memset(&lpc,0,sizeof(t_lpc)); strncpy(lpc.freq,CRYSTFREQ,7); lpc.roff=RAMOFFSET; + lpc.jaddr=RAMOFFSET; /* parse argv */ -- 2.39.2