ts-7000
[Top] [All Lists]

[ts-7000] serial blaster - tcdrain behaviour

To:
Subject: [ts-7000] serial blaster - tcdrain behaviour
From: chris dewbery <>
Date: Thu, 18 May 2006 14:48:16 +1200
Hi!

I have been experimenting with the serial_blaster tool, looks like a very useful
tool. :)

I did have one problem getting it running, receiving the following error.

$ ./serial_blaster
START
waiting for '<'
found '<'

--------- SENDING 2K BOOT FILE: "boot.bin" ---------
4352555301da8fe202c1a0e3d300a0e300f029e100f069e12c0000ebc20000eb310000e
<snip>
0000000000000000
2048 Bytes in 22 seconds.
--------------------------------------------------

waiting for '>'
ERROR!!! Expected '>' but found '<'

After comparing my output with the expected output from the readme file
I noticed that the time taken to send the boot.bin file was substantially
longer than the example.

After a bit of digging in the serial_blaster.c file I found the following 
section.

line 169:

        if(bverbose)
        {
                printf("%0.2x", (unsigned char  )ch);
                fflush(stdout);
                out_count += 2;

                WriteByte(fd, ch, TRUE); <<-- by setting this to true the 
WriteByte function
        }                                     calls tcdrain() for every byte. 
this behaviour
                                              differs from the !bverbose path 
which only calls
                                              tcdrain() every 1024 bytes.
        else
        {
                if((x%1024) == 0)
                {
                        printf(".");
                        fflush(stdout);
                        out_count++;
                }

                WriteByte(fd, ch, ((x%1024) == 0) );
        }

I found that if I changed the WriteByte(fd, ch, TRUE) line to read 
WriteByte(fd, ch, ((x%1024) == 0) );
everything works as expected.

This is most probably a mis-configuration on my behalf however I have attached 
a patch with my change
just incase others have the same issue.

my system configuration consists of:

        debian unstable, 2.4.32 kernel, gcc version 3.3.6 (Debian 1:3.3.6-12)


regards


Chris.


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
--- old/serial_blaster.c        2005-09-01 09:24:26.000000000 +1200
+++ new/serial_blaster.c        2006-05-18 14:08:44.000000000 +1200
@@ -171,7 +171,7 @@
                                fflush(stdout);
                                out_count += 2;
 
-                               WriteByte(fd, ch, TRUE);
+                               WriteByte(fd, ch, ((x%1024) == 0) );
                        }
                        else 
                        {
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU