This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Xmodem download problem


On Mon, 2001-10-08 at 18:57, Peter Graf wrote:
> Pushparaj wrote:
> 
> >By default I guess the minicom transfers 128 bytes. I am able to
> >download up to 31k. All small files below 31k get downloaded
> >(but not always !).
> >Big files of size more than 31k do not get downloaded.
> >[...]
> >I am working at 115.2k baud rate.
> 
> I had similar problems with high baudrates.
> 
> There are two things you should check.
> 
> First: Computing speed. 
> 
> You didn't say anything about FIFO's on your target, so maybe your hardware
> must handle modem protocol + send + receive, byte by byte in a polled
> manner. You didn't say anything about RedBoot running from ROM or RAM, so
> maybe you run it from ROM. On my target, instruction fetch from a 8 bit ROM
> device slowed down the CPU quite a lot.
> 
> Second: Timeouts in the serial driver.
> 
> For my target, there was a bug in packages\hal\sh\sh3\current\src\sh3_sci.c
> It uses a loop with CYGACC_CALL_IF_DELAY_US() to implement timeouts.
> Unfortunately the granularity was too big, so if RedBoot polled the port
> and did not immediately find a character, it timed out. Because one quantum
> of the timeout was about as long as the time between two received bytes.
> 
> I reduced the quantum for CYGACC_CALL_IF_DELAY_US() to 20 us, increased the
> number of loops and viola, it worked even from the unbuffered serial port.

Another thing to check is that HAL_DELAY_US() is working properly on 
your platform.  If you issue the command 'load -m xm' and _don't_ start
the download, how fast do the "C" characters come out?  They should come
out at a rate of about one every 3 seconds or so.  Any faster and the
timing will go all awry.

The other thing is that the xyModem code will give up after a certain
number of total retries.  This is by default set to 20.  You could try
making it larger.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]