EmbeddedRelated.com
Forums

Exit Code 0

Started by changj101010 April 26, 2004
We have developed an application with Rabbit3000 which is very
like the RCM3000. And we had every thing work OK months ago.
But today, when we want to reprogram it with an old code that we
have tested it before, DC(our version is Ver8.01) report "...Exit
Code 0" and "Time out ...." no matter use "program to RAM"
or "program to FALSH". According to the state reported by DC, all
the code is programed into the target(code loader, pilot, BIOS---the
flash is ereased, so no IDBlock in it. But it's same when use a
board with IDBlock in flash).
I have tried to place a endless loop in some where in
RabbitBios.c and at last, I found that if it was placed here(show
below), no "exit code 0" report and no Time Out reported.
......
#asm
BIOSCodeEnd:
StartUserCode::
x:
rst 0x28
jp x
#endasm
......
So I think there is not problem with code
before "StartUserCode". But this will not lead to success for I
can't insert my code here.
I also notice that in the RabbitBios.lst, some "unknown code" is
inserted after the "StartUserCode::", they are
......
[Rabbitbios.c(2741:1)]: #asm
[Rabbitbios.c(2742:1)]: BIOSCodeEnd:
[Rabbitbios.c(2743:1)]: StartUserCode::
[Rabbitbios.c(2744:1)]: #endasm
*** Unknown Code or Data ***
1d88 ED77 ld a,xpc 4
1d8a F5 push af 10
1d8b F1 pop af 7
1d8c ED67 ld xpc,a 4
1d8e C9 ret 8
1d8f ED77 ld a,xpc 4
1d91 F5 push af 10
1d92 F1 pop af 7
1d93 ED67 ld xpc,a 4
1d95 C9 ret 8
1d96 ED77 ld a,xpc 4
1d98 F5 push af 10
1d99 F1 pop af 7
1d9a ED67 ld xpc,a 4
1d9c C9 ret 8
......
And I don't know what function it plays but I think troubles
were caused by it.
So, my question is
What is the reason of "Exit Code 0"?
Why the bios doesn't jump to my "main()" function?
Can any one give me some advice, please?


"Program Terminated. Exit Code 0." is used to indicate successful
completion of a program (usually).

As for the other message you are getting, its hard to even guess
without know about your code here is a suggestion: explicitly exit
from your program by inserting the line "exit(0);" at the proper
location (ie. no other code will be executed after you call exit).
This may or not help but its a good habit just the same. You can
also change the value of exit(ex. exit(2);) just be certain that it
is "your" exit() being called and not something in your code causing
a "normal" exit.

I generally only get the "Timeout occurred while waiting for
debugger" message when I've left the program without properly
terminating my serial ports (that basically all I use the rabbit for
at the moment). If I forget to close a port and allow the program to
terminate it will terminate correctly and the I get the timeout
message (you can see the "Polling" frozen on the bottom of DC next to
the "IP = xx" field. I can't say for positive but I would suspect
that you are failing to properly terminate "something" in your code
that, when you exit, leaves the debugger in 'limbo' - hence the
message.

If you can, try explain what your program does or post the code you
think is causing the problem.

Good luck --- In rabbit-semi@rabb..., "changj101010" <changj10@v...>
wrote:
> We have developed an application with Rabbit3000 which is very
> like the RCM3000. And we had every thing work OK months ago.
> But today, when we want to reprogram it with an old code that
we
> have tested it before, DC(our version is Ver8.01) report "...Exit
> Code 0" and "Time out ...." no matter use "program to RAM"
> or "program to FALSH". According to the state reported by DC, all
> the code is programed into the target(code loader, pilot, BIOS---
the
> flash is ereased, so no IDBlock in it. But it's same when use a
> board with IDBlock in flash).
> I have tried to place a endless loop in some where in
> RabbitBios.c and at last, I found that if it was placed here(show
> below), no "exit code 0" report and no Time Out reported.
> ......
> #asm
> BIOSCodeEnd:
> StartUserCode::
> x:
> rst 0x28
> jp x
> #endasm
> ......
> So I think there is not problem with code
> before "StartUserCode". But this will not lead to success for I
> can't insert my code here.
> I also notice that in the RabbitBios.lst, some "unknown code"
is
> inserted after the "StartUserCode::", they are
> ......
> [Rabbitbios.c(2741:1)]: #asm
> [Rabbitbios.c(2742:1)]: BIOSCodeEnd:
> [Rabbitbios.c(2743:1)]: StartUserCode::
> [Rabbitbios.c(2744:1)]: #endasm
> *** Unknown Code or Data ***
> 1d88 ED77 ld a,xpc 4
> 1d8a F5 push af 10
> 1d8b F1 pop af 7
> 1d8c ED67 ld xpc,a 4
> 1d8e C9 ret 8
> 1d8f ED77 ld a,xpc 4
> 1d91 F5 push af 10
> 1d92 F1 pop af 7
> 1d93 ED67 ld xpc,a 4
> 1d95 C9 ret 8
> 1d96 ED77 ld a,xpc 4
> 1d98 F5 push af 10
> 1d99 F1 pop af 7
> 1d9a ED67 ld xpc,a 4
> 1d9c C9 ret 8
> ......
> And I don't know what function it plays but I think troubles
> were caused by it.
> So, my question is
> What is the reason of "Exit Code 0"?
> Why the bios doesn't jump to my "main()" function?
> Can any one give me some advice, please?




At 16:41 26-4-04, you wrote:
>"Program Terminated. Exit Code 0." is used to indicate successful
>completion of a program (usually).

Since this is reported as a problem, I'm guessing the program wasn't
supposed to exit at all. So it somehow escapes from its mainloop. Might be
a stack problem or just a wrong jump. :)

Maurits.
HiTECHnologies Industrial Automation B.V.
Industrieweg 30, 3401 MA, IJsselstein, The Netherlands
P.O. box 242, 3400 AE, IJsselstein, The Netherlands
Tel: +31 30 6875335
Fax: +31 30 6875333
E-mail: info@info...
Web: www.hitechnologies.nl

===================================================================
The information contained in this communication is confidential
and may be legally privileged. It is intended solely for the
use of the individual or entity to whom it is addressed and
others authorised to receive it. If you are not the intended
recipient you are hereby notified that any disclosure, copying,
distribution or taking any action in reliance on the contents
of this information is strictly prohibited and may be unlawful.
HiTECHnologies B.V. is neither liable for the contents, nor
for the proper, complete and timely transmission of the
information contained in this communication.
===================================================================


Is inline I/O optimization enabled? If so, try disabling it. Dynamic C
8.01 has a bug in the inline I/O optimization which can cause odd behavior
such as you describe.

Also, if no ID block is present, then Dynamic C will treat the board as if
it a BL1810 (Jackrabbit) board. Does your application use any features
that rely on run time recognition of the board type?

At 05:24 AM 4/26/04, you wrote:
> We have developed an application with Rabbit3000 which is very
>like the RCM3000. And we had every thing work OK months ago.
> But today, when we want to reprogram it with an old code that we
>have tested it before, DC(our version is Ver8.01) report "...Exit
>Code 0" and "Time out ...." no matter use "program to RAM"
>or "program to FALSH". According to the state reported by DC, all
>the code is programed into the target(code loader, pilot, BIOS---the
>flash is ereased, so no IDBlock in it. But it's same when use a
>board with IDBlock in flash).
> I have tried to place a endless loop in some where in
>RabbitBios.c and at last, I found that if it was placed here(show
>below), no "exit code 0" report and no Time Out reported.
> ......
> #asm
> BIOSCodeEnd:
> StartUserCode::
> x:
> rst 0x28
> jp x
> #endasm
> ......
> So I think there is not problem with code
>before "StartUserCode". But this will not lead to success for I
>can't insert my code here.
> I also notice that in the RabbitBios.lst, some "unknown code" is
>inserted after the "StartUserCode::", they are
> ......
>[Rabbitbios.c(2741:1)]: #asm
>[Rabbitbios.c(2742:1)]: BIOSCodeEnd:
>[Rabbitbios.c(2743:1)]: StartUserCode::
>[Rabbitbios.c(2744:1)]: #endasm
>*** Unknown Code or Data ***
> 1d88 ED77 ld a,xpc 4
> 1d8a F5 push af 10
> 1d8b F1 pop af 7
> 1d8c ED67 ld xpc,a 4
> 1d8e C9 ret 8
> 1d8f ED77 ld a,xpc 4
> 1d91 F5 push af 10
> 1d92 F1 pop af 7
> 1d93 ED67 ld xpc,a 4
> 1d95 C9 ret 8
> 1d96 ED77 ld a,xpc 4
> 1d98 F5 push af 10
> 1d99 F1 pop af 7
> 1d9a ED67 ld xpc,a 4
> 1d9c C9 ret 8
> ......
> And I don't know what function it plays but I think troubles
>were caused by it.
> So, my question is
> What is the reason of "Exit Code 0"?
> Why the bios doesn't jump to my "main()" function?
> Can any one give me some advice, please? >
>Yahoo! Groups Links >
>