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


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.

Bye,
Peter


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