From a2e8f16f2d595f007ebf1bfe041927702e161c9c Mon Sep 17 00:00:00 2001 From: hackbard Date: Sat, 28 Jul 2007 05:39:35 +0200 Subject: [PATCH] go-to-bed-push, partid/bootcode version still wrong! --- betty/lpcload.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/betty/lpcload.c b/betty/lpcload.c index e2bef73..bdb3948 100644 --- a/betty/lpcload.c +++ b/betty/lpcload.c @@ -189,6 +189,7 @@ int main(int argc,char **argv) { /* auto baud sequence */ + printf("auto baud sequence ...\n"); write(tts_fd,"?",1); len=0; txrx(tts_fd,buf,&len,info); @@ -198,6 +199,8 @@ int main(int argc,char **argv) { } /* tell bl that we are synchronized (it's allready in buf) */ + + printf("sync sequence ...\n"); len=14; txrx(tts_fd,buf,&len,info); if(strncmp(buf,"OK\r\n",4)) { @@ -206,6 +209,8 @@ int main(int argc,char **argv) { } /* tell bl the crystal frequency */ + + printf("frequency setting sequence ...\n"); len=strlen(cfreq)+2; strncpy(buf,cfreq,BUFSIZE); buf[len-2]='\r'; @@ -216,6 +221,24 @@ int main(int argc,char **argv) { return -1; } + /* read part id */ + printf("read part id ...\n"); + len=3; + memcpy(buf,"J\r\n",3); + txrx(tts_fd,buf,&len,info); + buf[len]='\0'; + printf("part id: %d (0x%x)\n",atoi(buf),atoi(buf+3)); + + /* read boot code version */ + printf("read boot code version ...\n"); + len=3; + memcpy(buf,"K\r\n",3); + txrx(tts_fd,buf,&len,info); + buf[len]='\0'; + printf("boot code version: %c %c\n",(buf),atoi(buf)); + + + // to be continued ... (parsing fw file and poking it to ram) -- 2.39.2