EmbeddedRelated.com
Forums

Timeout dilemma

Started by syedmhussein January 8, 2007
I am using a Rabbit 3000 for my current application. I am compiling
in Flash and running in RAM.

I have been facing alot of timeout issues and they seem to keep
coming in a variety of 3, even though no change has been made to the
code:

While Debugging; Timeout while waiting for response from
target

While Sending User Program;Timeout while waiting for response
from target

While Sending/Compiling BIOS; Timeout while waiting for
response from target

However, the first timeout issue seems to be the most frequent. I
would appreciate it greatly we could avoid the timeout problems
currently faced. I will like to add that on occassions it runs
perfectly (or as intended). I have attached my code below.

Thank you.

main()
{
auto char inBuffer[BUFFYSIZE];
auto int n;
serBopen(9600);
serBrdFlush();
serBwrFlush();

serCopen(9600);
serCrdFlush();
serCwrFlush();

while(1)
{
if(serBpeek() != -1)
{

while ((n = serBread(inBuffer, BUFFYSIZE-1,
TIMEOUT)) == 0) ;
inBuffer[n] = '\0';
printf("T3: Received %s bits: %d\n",
inBuffer,n);
serCputs(inBuffer);
}
}
}
I don't think it anything to do with your code. I get these on
occasion, and simply re-run with no issue. Most of my experience is
with DC9.10 and rabbit 3000's. It feels to me like a windows/serial
timing issue. I'm interested in any other comments.

Jon

--- In r..., "syedmhussein"
wrote:
>
> I am using a Rabbit 3000 for my current application. I am compiling
> in Flash and running in RAM.
>
> I have been facing alot of timeout issues and they seem to keep
> coming in a variety of 3, even though no change has been made to the
> code:
>
> While Debugging; Timeout while waiting for response from
> target
>
> While Sending User Program;Timeout while waiting for response
> from target
>
> While Sending/Compiling BIOS; Timeout while waiting for
> response from target
>
> However, the first timeout issue seems to be the most frequent. I
> would appreciate it greatly we could avoid the timeout problems
> currently faced. I will like to add that on occassions it runs
> perfectly (or as intended). I have attached my code below.
>
> Thank you.
>
> main()
> {
> auto char inBuffer[BUFFYSIZE];
> auto int n;
> serBopen(9600);
> serBrdFlush();
> serBwrFlush();
>
> serCopen(9600);
> serCrdFlush();
> serCwrFlush();
>
> while(1)
> {
> if(serBpeek() != -1)
> {
>
> while ((n = serBread(inBuffer, BUFFYSIZE-1,
> TIMEOUT)) == 0) ;
> inBuffer[n] = '\0';
> printf("T3: Received %s bits: %d\n",
> inBuffer,n);
> serCputs(inBuffer);
> }
> }
> }
>
Its my belief that nearly all rabbit user using DC connected to thier
target via the serial port experience these problems.

I have been using rabbits with DC8.51 and DC9.25 on and off for two
years. I get timeouts just about every day of development. It
does'nt seem to matter how simple/complex the code is or which target
board I use.

Its a bit annoying, but I now nearly always now reset the the target,
press the disconnect button in DC and then re-compile/load for the
next software development itteration.
This seems to reduce the number of timeouts and "target not found"
issues quite a lot.

Its my guess that if you just disconnect, change your code, and then
compile/download it sometimes catches the target with its knickers
down somewhere.

Try reseting your target before each compile/download.

Neil

--- In r..., "syedmhussein"
wrote:
>
> I am using a Rabbit 3000 for my current application. I am compiling
> in Flash and running in RAM.
>
> I have been facing alot of timeout issues and they seem to keep
> coming in a variety of 3, even though no change has been made to
the
> code:
>
> While Debugging; Timeout while waiting for response from
> target
>
> While Sending User Program;Timeout while waiting for response
> from target
>
> While Sending/Compiling BIOS; Timeout while waiting for
> response from target
>
> However, the first timeout issue seems to be the most frequent. I
> would appreciate it greatly we could avoid the timeout problems
> currently faced. I will like to add that on occassions it runs
> perfectly (or as intended). I have attached my code below.
>
> Thank you.
>
> main()
> {
> auto char inBuffer[BUFFYSIZE];
> auto int n;
> serBopen(9600);
> serBrdFlush();
> serBwrFlush();
>
> serCopen(9600);
> serCrdFlush();
> serCwrFlush();
>
> while(1)
> {
> if(serBpeek() != -1)
> {
>
> while ((n = serBread(inBuffer, BUFFYSIZE-1,
> TIMEOUT)) == 0) ;
> inBuffer[n] = '\0';
> printf("T3: Received %s bits: %d\n",
> inBuffer,n);
> serCputs(inBuffer);
> }
> }
> }
>
Please try the following code to check if the Timeout
While Waiting for Response from Target still occurs. I
think other timeouts are related to windows problems
instead of your code, since they happens when the
compiler tries to communicate to target to upload the
code.
In my case, most of the Debug Timeouts were related
to "wild strings". I mean, strings without null
terminator. I see you put the Null on the 'n' position
but maybe the 'n' value goes wild sometimes causing
the debug timeout.

main()
{
auto char inBuffer[BUFFYSIZE];
auto int n;
serBopen(9600);
serBrdFlush();
serBwrFlush();
serCopen(9600);
serCrdFlush();
serCwrFlush();
while(1)
{
if(serBpeek() != -1)
{
while ((n = serBread(inBuffer,BUFFYSIZE-1,
TIMEOUT)) == 0) ;
inBuffer[strlen(inBuffer)] = '\0';
printf("T3: Received %s bits:%d\n",inBuffer,n);
serCputs(inBuffer);
memset(inBuffer,'\0',sizeof(inBuffer));
}
}
}

--- syedmhussein escreveu:

> I am using a Rabbit 3000 for my current application.
> I am compiling
> in Flash and running in RAM.
>
> I have been facing alot of timeout issues and they
> seem to keep
> coming in a variety of 3, even though no change has
> been made to the
> code:
>
> While Debugging; Timeout while waiting for response
> from
> target
>
> While Sending User Program;Timeout while waiting
> for response
> from target
>
> While Sending/Compiling BIOS; Timeout while waiting
> for
> response from target
>
> However, the first timeout issue seems to be the
> most frequent. I
> would appreciate it greatly we could avoid the
> timeout problems
> currently faced. I will like to add that on
> occassions it runs
> perfectly (or as intended). I have attached my code
> below.
>
> Thank you.
>
> main()
> {
> auto char inBuffer[BUFFYSIZE];
> auto int n;
> serBopen(9600);
> serBrdFlush();
> serBwrFlush();
>
> serCopen(9600);
> serCrdFlush();
> serCwrFlush();
>
> while(1)
> {
> if(serBpeek() != -1)
> {
>
> while ((n = serBread(inBuffer,
> BUFFYSIZE-1,
> TIMEOUT)) == 0) ;
> inBuffer[n] = '\0';
> printf("T3: Received %s bits:
> %d\n",
> inBuffer,n);
> serCputs(inBuffer);
> }
> }
> }
>
__________________________________________________
Fale com seus amigos de gra com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/