[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: e100boot for Windows UPDATE



OK, here's some more information on using the Windows tool with the latest (R2_0_5) tools build. There appears to be a timing issue probably related to changes in the way the delay loops are now handled in the client portion of the bootloader. 
Nevertheless, I was able to get the tools to work by increasing delays between packets (turning on the printf debug statements that are normally commented out in the eboot.c code will do it). This is not an optimum solution but it did allow me to verify that my changes to the server bootloader files in the R2_0_5 release work. 

I am making some changes to the windows source and will post the diffs if you are interested once I get all the bugs worked out. 

Here's is a patch against the tools directory for the file "tools-build-R2_0_5.tgz". That incorporates the same changes as my previous patch for the older release.

As you are probably aware this version of the network bootloader sends status information back through the network which is very nice -- you no longer have to have a serial debug port hooked up to find out why your flash update didn't! It will do the same for windows port as well.

Happy times,

--David Kilp

-----------------------------[CUT]-------------------------------------

diff -r -c tools/build/e100boot/doc/e100boot.pod tools.new/build/e100boot/doc/e100boot.pod
*** tools/build/e100boot/doc/e100boot.pod	Fri Nov 22 07:03:40 2002
--- tools.new/build/e100boot/doc/e100boot.pod	Fri Jan 31 20:12:41 2003
***************
*** 10,20 ****
  [B<--flashfill> I<fill-value> I<flash-offset> I<size>] [B<--pause> I<iter>]
  [B<--memtest> I<addr> I<addr>] [B<--memclear> I<addr> I<addr>]
  [B<--memdump> I<addr> I<addr>] [B<--setreg> I<addr>|I<regname> I<val>]
! [B<--getreg> I<addr>|I<regname>] [B<--verify> I<addr> I<val>]
  [B<--label> I<label>] [B<--loop> I<addr> I<label>] [B<--5400>] [B<--5600>]
  [B<--testcard>] [B<--devboard>] [B<--testcardlx>] [B<--network>] [B<--serial>]
! [B<--baudrate> I<baudrate>] [B<--bootfile> I<file>] [B<--jump> I<addr>]
! [B<--tofiles>] [B<--cmdsonly>] [B<--images>] [B<--noleds>] [B<--help>]
  
  =head1 DESCRIPTION
  
--- 10,21 ----
  [B<--flashfill> I<fill-value> I<flash-offset> I<size>] [B<--pause> I<iter>]
  [B<--memtest> I<addr> I<addr>] [B<--memclear> I<addr> I<addr>]
  [B<--memdump> I<addr> I<addr>] [B<--setreg> I<addr>|I<regname> I<val>]
! [B<--getreg> I<addr>|I<regname>] [B<--verify> I<addr> I<val>] 
  [B<--label> I<label>] [B<--loop> I<addr> I<label>] [B<--5400>] [B<--5600>]
  [B<--testcard>] [B<--devboard>] [B<--testcardlx>] [B<--network>] [B<--serial>]
! [B<--baudrate> I<baudrate>] [B<--bootfile> I<file>] [B<--jump> I<addr>] 
! [B<--tofiles>] [B<--cmdsonly>] [B<--images>] [B<--noleds>] 
! [B<--tofile> I<filename>] [B<--help>]
  
  =head1 DESCRIPTION
  
***************
*** 232,237 ****
--- 233,244 ----
  
  Write packets to files e100boot.seq[0..]. Does not transmit the data.
  
+ =item B<--tofile>
+ 
+ Write packets to files specified. Does not transmit the data.
+ This is intended for use with the Microsoft Windows eboot.exe network
+ boot utility.
+ 
  =item B<--verify> I<address value>
  
  Verify that memory contains dword. If not loader will stop. This is to
diff -r -c tools/build/e100boot/sbl/common.c tools.new/build/e100boot/sbl/common.c
*** tools/build/e100boot/sbl/common.c	Fri Nov 22 07:03:40 2002
--- tools.new/build/e100boot/sbl/common.c	Fri Jan 31 20:05:01 2003
***************
*** 55,60 ****
--- 55,62 ----
                                     warn that it might take some
                                     time. */
  
+ char ofilename[256]; //Andrey
+ FILE *singlefd=NULL;	//Added by Andrey for writing a single file
  int toFiles             = FALSE;        /* Dump all packets to files. */
  int cmdsOnly            = FALSE;        /* Just dump boot cmds to file. */
  int netBoot             = TRUE;         /* Do network boot? */
***************
*** 163,168 ****
--- 165,182 ----
      printf("We're doing a flash write, this may take up to a few minutes...\n");
    }
  
+   if (singlefd) { // added by Andrey
+     udword seq = 0;
+     struct packet_buf *p;
+ 
+     while((p = create_packet(seq++))) {
+       SendToDevice(p->data, p->size);
+     }
+     fclose(singlefd);
+     printf ("Created file %s to be loaded by other eboot loader\n",ofilename);
+     exit(0);
+   }
+ 
    if (toFiles) {
      udword seq = 0;
      struct packet_buf *p;
***************
*** 486,491 ****
--- 500,514 ----
        toFiles = TRUE;
      }
  
+     else if (strncmp(argVect[argi], "--tofile", 8) == 0) { // added by Andrey - should be after "--tofiles?"
+       GetStringOption(&argi, argCount, argVect, 
+                       ofilename, "--tofile");
+       if ((singlefd = fopen(ofilename, "w+")) == NULL) {
+         printf("Cannot open/create '%s'. %s.\n", ofilename, strerror(errno));
+         exit(1);
+       }
+     }
+ 
      else if (strncmp(argVect[argi], "--cmdsonly", 10) == 0) {
        cmdsOnly = TRUE;
      }
***************
*** 1116,1121 ****
--- 1139,1145 ----
           "         [--testcardlx] [--network] [--serial]\n"
           "         [--baudrate baudrate] [--bootfile file] [--jump addr]\n"
           "         [--tofiles] [--cmdsonly] [--images] [--noleds]\n"
+          "         [--tofile file]\n"
           "         [--help]\n\n");
  
    printf("         The commands sent to the cbl, and which are parsed by the cbl,\n"
diff -r -c tools/build/e100boot/sbl/common.h tools.new/build/e100boot/sbl/common.h
*** tools/build/e100boot/sbl/common.h	Fri Nov 22 07:03:40 2002
--- tools.new/build/e100boot/sbl/common.h	Fri Jan 31 20:05:01 2003
***************
*** 46,51 ****
--- 46,52 ----
  extern struct packet_buf *first_packet;
  extern int cmdsOnly;	/* Just dump boot cmds to file. */
  extern int toFiles;	/* Dump all packets to files. */
+ extern FILE *singlefd;	//Added for writing a single file
  
  /**************************  Function prototypes  **************************/
  
diff -r -c tools/build/e100boot/sbl/network.c tools.new/build/e100boot/sbl/network.c
*** tools/build/e100boot/sbl/network.c	Fri Nov 22 07:03:40 2002
--- tools.new/build/e100boot/sbl/network.c	Fri Jan 31 20:05:01 2003
***************
*** 603,608 ****
--- 603,610 ----
      fwrite(data, data_len, 1, fd);
      fclose(fd);
    }
+   // Added by Andrey - to write to a single file
+   else if (singlefd) fwrite(data, data_len, 1, singlefd);
    else if (sendto(sock_fd, data, data_len, 0, &sock_addr, sizeof(sock_addr)) < 0) {
      perror("Sendto failed:");
      exit(EXIT_FAILURE);
-----------------------------[CUT]-------------------------------------

> -----Original Message-----
> From: Mikael Starvik [mailto:mikael.starvik@xxxxxxx.com]
> Sent: Friday, January 31, 2003 1:05 AM
> To: David Kilp; dev-etrax
> Subject: RE: e100boot for Windows available?
> 
> 
> Nice! Would it be possible for you to share the code with the rest
> of the world?
> 
> (e100boot has no license AFAIK and is not contaminated by GPL
> which means that you can choose to keep the code proprietary)
> 
> /Mikael
> 
> -----Original Message-----
> From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
> Behalf Of David Kilp
> Sent: Thursday, January 30, 2003 11:31 PM
> To: dev-etrax
> Subject: RE: e100boot for Windows available?
> 
> 
> Thanks for the information. After a few minor tweaks to my 
> existing e100boot.c file, I was able to use this program and 
> perform a successful network upgrade from a Win-2K laptop. 
> 
> You certainly saved me a bunch of time! Thanks!
> 
> --David Kilp 
> 
> > -----Original Message-----
> > From: Mikael Starvik [mailto:starvik@xxxxxxx.com]
> > Sent: Thursday, January 30, 2003 1:19 AM
> > To: David Kilp; dev-etrax
> > Subject: RE: e100boot for Windows available?
> > 
> > 
> > One of our customers have made a flashing utility for windows.
> > http://www.elphel.com/downloads/index.html.
> > 
> > I have never tested it and I don' know how compatible it is
> > with e100boot. Otherwise I agree that I should be rater simple to
> >  port e100boot to windows with libpcap for windows or similar.
> > Maybe it I can be tricky to get it to work on all different
> > Windows versions.
> > 
> > /Mikael
> > 
> > -----Original Message-----
> > From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
> > Behalf Of David Kilp
> > Sent: Wednesday, January 29, 2003 11:56 PM
> > To: dev-etrax
> > Subject: e100boot for Windows available?
> > 
> > 
> > Just wondering if anyone has ported the flashing utility, 
> > e100boot, to a Windows platform? There are times where it 
> > would be useful to reflash a unit without having a Linux box 
> > around (sad as that may seem....). 
> > 
> > Looking at the code, it seems like it's doable at least for 
> > the server-side portion (sbl). The client side part would 
> > still have to be built on the Linux side and the resulting 
> > images copied over but seems possible. Just thought I'd see 
> > if somebody has already done it and would like to share the results.
> > 
> > Thanks,
> > 
> > David Kilp
> > 
>