public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Redboot: [xyz]modem via TCP?
@ 2001-02-06 11:37 Grant Edwards
  2001-02-08 14:29 ` Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2001-02-06 11:37 UTC (permalink / raw)
  To: ecos-discuss

With Redboot, can you do [xyz]modem download via TCP instead of
serial port?  It looks like it should work, but I don't have an
easy way to try it.  It would be a nice alternative to running 
a TFTP server, so I might try to impliment it if it doesn't work
already.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot: [xyz]modem via TCP?
  2001-02-06 11:37 [ECOS] Redboot: [xyz]modem via TCP? Grant Edwards
@ 2001-02-08 14:29 ` Grant Edwards
  2001-02-09  5:29   ` Gary Thomas
  2001-04-18 11:02   ` Grant Edwards
  0 siblings, 2 replies; 6+ messages in thread
From: Grant Edwards @ 2001-02-08 14:29 UTC (permalink / raw)
  To: ecos-discuss

On Tue, Feb 06, 2001 at 07:37:24PM +0000, Grant Edwards wrote:

> With Redboot, can you do [xyz]modem download via TCP instead of
> serial port?

I slapped together a Python program that uses "sx" to download
an S record file via TCP using xmodem protocol.  Small files
(less than 2K or so) work fine, but when I get up to about 2K,
RedBoot crashes.  I can load thelarge files fine via TFTP and
xmodem/serial.

Anybody else see anything like this?

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot: [xyz]modem via TCP?
  2001-02-08 14:29 ` Grant Edwards
@ 2001-02-09  5:29   ` Gary Thomas
  2001-02-09  7:24     ` Grant Edwards
  2001-02-09 10:36     ` Grant Edwards
  2001-04-18 11:02   ` Grant Edwards
  1 sibling, 2 replies; 6+ messages in thread
From: Gary Thomas @ 2001-02-09  5:29 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss

On 08-Feb-2001 Grant Edwards wrote:
> On Tue, Feb 06, 2001 at 07:37:24PM +0000, Grant Edwards wrote:
> 
>> With Redboot, can you do [xyz]modem download via TCP instead of
>> serial port?
> 
> I slapped together a Python program that uses "sx" to download
> an S record file via TCP using xmodem protocol.  Small files
> (less than 2K or so) work fine, but when I get up to about 2K,
> RedBoot crashes.  I can load thelarge files fine via TFTP and
> xmodem/serial.
> 
> Anybody else see anything like this?

I've not tried this.  If you want to share [only with me if necessary]
the Python program, I'll give it a look-see when I get a chance.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot: [xyz]modem via TCP?
  2001-02-09  5:29   ` Gary Thomas
@ 2001-02-09  7:24     ` Grant Edwards
  2001-02-09 10:36     ` Grant Edwards
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2001-02-09  7:24 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

On Fri, Feb 09, 2001 at 06:29:10AM -0700, Gary Thomas wrote:

> >> With Redboot, can you do [xyz]modem download via TCP instead of
> >> serial port?
> > 
> > I slapped together a Python program that uses "sx" to download
> > an S record file via TCP using xmodem protocol.  Small files
> > (less than 2K or so) work fine, but when I get up to about 2K,
> > RedBoot crashes.  I can load the large files fine via TFTP and
> > xmodem/serial.
> > 
> > Anybody else see anything like this?
> 
> I've not tried this.  If you want to share [only with me if necessary]
> the Python program, I'll give it a look-see when I get a chance.

Thanks. 

Here it is.  I didn't try any variations on protocol/frame-size
or anything.  Just the defualt x-modem mode. IP addresse and
filename are hard-coded...

========================================================================
import time
import socket
import os
import sys

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.1.21',9000))

print "connected to: ",s.getpeername()," from ",s.getsockname()

r = s.recv(1024)

print "received: ",r

if not r.startswith("RedBoot"):
    raise "No answer from RedBoot"

s.send("load -m x\r")

r = s.recv(1024)
print  "received: ",r

fd = s.fileno()
os.dup2(fd,0)
os.dup2(fd,1)

os.spawnv(os.P_WAIT,"/usr/bin/sx",("/usr/sbin/sx","-v","dataFile.srec"))

sys.stderr.write("done\n");
s.close()
========================================================================

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot: [xyz]modem via TCP?
  2001-02-09  5:29   ` Gary Thomas
  2001-02-09  7:24     ` Grant Edwards
@ 2001-02-09 10:36     ` Grant Edwards
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2001-02-09 10:36 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

On Fri, Feb 09, 2001 at 06:29:10AM -0700, Gary Thomas wrote:

> >> With Redboot, can you do [xyz]modem download via TCP instead of
> >> serial port?
> > 
> > I slapped together a Python program that uses "sx" to download
> > an S record file via TCP using xmodem protocol.  Small files
> > (less than 2K or so) work fine, but when I get up to about 2K,
> > RedBoot crashes.  I can load thelarge files fine via TFTP and
> > xmodem/serial.
> > 
> > Anybody else see anything like this?
> 
> I've not tried this.  If you want to share [only with me if necessary]
> the Python program, I'll give it a look-see when I get a chance.

Could the X Modem stuff be getting messed up by the code in
net_io.c that interprets Telnet escape/command characters?  The
data file (Motorola S-records) is all ASCII, so it would have
to be the protocol stuff itself.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot: [xyz]modem via TCP?
  2001-02-08 14:29 ` Grant Edwards
  2001-02-09  5:29   ` Gary Thomas
@ 2001-04-18 11:02   ` Grant Edwards
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2001-04-18 11:02 UTC (permalink / raw)
  To: ecos-discuss

> > With Redboot, can you do [xyz]modem download via TCP instead of
> > serial port?
> 
> I slapped together a Python program that uses "sx" to download
> an S record file via TCP using xmodem protocol.  Small files
> (less than 2K or so) work fine, but when I get up to about 2K,
> RedBoot crashes.  I can load thelarge files fine via TFTP and
> xmodem/serial.

I've been messing around with this intermittently for a few
days and haven't made any progress.  I had to disable the
telnet command character processing in net_io.c so that x-modem
packets are allowed through "raw".  After that I can download
some files, but not others.  With DEBUG enabled in xyzModem.c,
I get errors because things (e.g. the ram_start variable) is
being overwritten by data from x-modem packets.  With DEBUG
disabled, I get different error behavior.  There must be a
buffer overflow somewhere, but I havn't been able to find it.

I've noticed that if the s-record code decides to give up, the
x-modem link isn't shut down gracefully and the other end keeps
sending retries that are interpreted by RedBoot as commands.
That's not very easy to fix since the s-record routines only
have a "getc()" routine to call and no way to shut down the
transfer when an error is detected.

Since x-modem won't work due to telnet command processing
anyway, I think I'm going to try a third "direct" mode where
the s-record file is accepted directly rather than being
encapsulated in x-modem packets.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-04-18 11:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-06 11:37 [ECOS] Redboot: [xyz]modem via TCP? Grant Edwards
2001-02-08 14:29 ` Grant Edwards
2001-02-09  5:29   ` Gary Thomas
2001-02-09  7:24     ` Grant Edwards
2001-02-09 10:36     ` Grant Edwards
2001-04-18 11:02   ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).