From: hackbard Date: Sat, 28 Jul 2007 03:39:35 +0000 (+0200) Subject: go-to-bed-push, partid/bootcode version still wrong! X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=a2e8f16f2d595f007ebf1bfe041927702e161c9c;p=my-code%2Farm.git go-to-bed-push, partid/bootcode version still wrong! --- 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)