EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Dynamic C 10.2x problems

Started by Unknown June 26, 2008
Dear Everyone,

I had difficulties with Dynamic C 10.09 so I decided to move to version
10.21. My problem with this one is, when I get errors during a compilation
and then try to compile anything (including the simplest sample programs) I
get the compiler message:

line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg origin
directive.
line 38 : ERROR Rabbitbios.c : Out of root code space, try moving code
to XMEM.
The only thing I could do is quitting Dynamic C and starting it again, after
that it works ok until the first compilation error. The same with 10.23
under Win2K and XP as well. Any ideas?

Thanks, Gusztav
I forgot to post that I use an RCM4200 and all the bios libs are factory
default.

The problem I had with version 10.09 was that I have several nested
cofunctions in my code, and sometimes they return to the wrong line
after *yield;
*like in the following example:

cof_1()
{
...
wfd {cof_2()}
...
}
cof_2()
{
...
wfd {cof_3()} <--instead of returning to this
statement <--returns to this
...
}

cof_3()
{
...
yield;
...
}

This of course causes program failure. I confirmed this by execution tracing
and single stepping as well. Rabbit tech support asked me for a sample code
so they can reconstruct the problem but it's quite difficult since the
program is very complex and is based on communication with external devices.
I spent months with this problem, so any ideas on this are most welcome as
well :)

Thanks in advance, Gusztav
On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi wrote:

> Dear Everyone,
>
> I had difficulties with Dynamic C 10.09 so I decided to move to version
> 10.21. My problem with this one is, when I get errors during a compilation
> and then try to compile anything (including the simplest sample programs) I
> get the compiler message:
>
> line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg origin
> directive.
> line 38 : ERROR Rabbitbios.c : Out of root code space, try moving code
> to XMEM.
> The only thing I could do is quitting Dynamic C and starting it again,
> after that it works ok until the first compilation error. The same with
> 10.23 under Win2K and XP as well. Any ideas?
>
> Thanks, Gusztav
>
Well,

Dynamic C doesn't like many nested cofucntions to begin with, so it's probably good practice to stick to nothing more than 2-3, (I've had no problems using 2 nested costates and cofunctions)

In regards to your errors, try

Adding

#memmap xmem

To the top of your code

Also make sure that you have "enable separate instruction and data spaces" check box ticked (this can be found under project option within the compiler tab)

Good luck

Rony

From: r... [mailto:r...] On Behalf Of Guszt Gyori
Sent: Thursday, 26 June 2008 7:26 PM
To: r...
Subject: [!! SPAM] [rabbit-semi] Re: Dynamic C 10.2x problems

I forgot to post that I use an RCM4200 and all the bios libs are factory default.

The problem I had with version 10.09 was that I have several nested cofunctions in my code, and sometimes they return to the wrong line after yield; like in the following example:

cof_1()
{
...
wfd {cof_2()}
...
}

cof_2()
{
...
wfd {cof_3()} <--instead of returning to this
statement <--returns to this
...
}

cof_3()
{
...
yield;
...
}

This of course causes program failure. I confirmed this by execution tracing and single stepping as well. Rabbit tech support asked me for a sample code so they can reconstruct the problem but it's quite difficult since the program is very complex and is based on communication with external devices. I spent months with this problem, so any ideas on this are most welcome as well :)

Thanks in advance, Gusztav

On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi wrote:

Dear Everyone,

I had difficulties with Dynamic C 10.09 so I decided to move to version 10.21. My problem with this one is, when I get errors during a compilation and then try to compile anything (including the simplest sample programs) I get the compiler message:

line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg origin directive.
line 38 : ERROR Rabbitbios.c : Out of root code space, try moving code to XMEM.

The only thing I could do is quitting Dynamic C and starting it again, after that it works ok until the first compilation error. The same with 10.23 under Win2K and XP as well. Any ideas?

Thanks, Gusztav
Thanks for the advice. I already sorted out the first problem: DynC 10.2x
didn't want to compile anything that was modified but not saved, don't know
why. The cofunction problem is not that simple, I'm afraid. I'm trying to
port a program which has been written to an RCM3700 with DynC 9.21 to an
RCM4200 because we were absolutely out of data space (constant and variable
as well, using separate i&d, of course), and hoped that far variables will
help futher development. The same nested cofunctions worked fine on the
RCM3700. The problem is that the very inner cofunction does the
communication with the external devices, and is the most essential part of
the program, being called from over 80 different locations and the program
itself is well over 8000 lines, so making any change to its structure would
be hell of a job. If anyone had to face similar problems, please help!

Thanks, Gusztav
2008/6/27 Adnan Mohammad-Ali :

> Well,
>
> Dynamic C doesn't like many nested cofucntions to begin with, so it's
> probably good practice to stick to nothing more than 2-3, (I've had no
> problems using 2 nested costates and cofunctions)
>
>
>
> In regards to your errors, try
>
> Adding
>
> #memmap xmem
>
> To the top of your code
>
> Also make sure that you have "enable separate instruction and data spaces"
> check box ticked (this can be found under project option within the compiler
> tab)
>
>
>
> Good luck
>
> Rony
>
>
>
> *From:* r... [mailto:r...] *On
> Behalf Of *Guszt Gyori
> *Sent:* Thursday, 26 June 2008 7:26 PM
> *To:* r...
> *Subject:* [!! SPAM] [rabbit-semi] Re: Dynamic C 10.2x problems
>
>
>
> I forgot to post that I use an RCM4200 and all the bios libs are factory
> default.
>
>
>
> The problem I had with version 10.09 was that I have several nested
> cofunctions in my code, and sometimes they return to the wrong line after
> *yield; *like in the following example:
>
>
>
> cof_1()
> {
> ...
> wfd {cof_2()}
> ...
> }
>
>
> cof_2()
> {
> ...
> wfd {cof_3()} <--instead of returning to this
> statement <--returns to this
> ...
> }
>
> cof_3()
> {
> ...
> yield;
> ...
> }
>
>
>
> This of course causes program failure. I confirmed this by execution
> tracing and single stepping as well. Rabbit tech support asked me for a
> sample code so they can reconstruct the problem but it's quite difficult
> since the program is very complex and is based on communication with
> external devices. I spent months with this problem, so any ideas on this are
> most welcome as well :)
>
>
>
> Thanks in advance, Gusztav
>
> On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi
> wrote:
>
> Dear Everyone,
>
>
>
> I had difficulties with Dynamic C 10.09 so I decided to move to version
> 10.21. My problem with this one is, when I get errors during a compilation
> and then try to compile anything (including the simplest sample programs) I
> get the compiler message:
>
>
>
> line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg origin
> directive.
> line 38 : ERROR Rabbitbios.c : Out of root code space, try moving code
> to XMEM.
>
> The only thing I could do is quitting Dynamic C and starting it again,
> after that it works ok until the first compilation error. The same with
> 10.23 under Win2K and XP as well. Any ideas?
>
>
>
> Thanks, Gusztav
>
>
>
>
>
Gusztav,

I've experienced the exact same issue in with DC10.21 and an RCM4010
which basically cost me a return trip to my customer site (grumble
grumble). The program has three main costates, one of which can nest
cofuncs up to four levels deep (these cofuncs are fairly simple and
straightforward code). It was always the deepest cofunc that failed to
resume at a waitfor statement-- it would resume at the statement after
the cofunc call instead (which derails things as you might expect). I
experimented with different constructs at the problem spot-- such as
using an explicit test and yield and also moving the problem cofunc one
level deeper but still it failed.

This is a fairly large program (~240KB) which relies on numerous custom
libraries, so it's not easy to produce a test case I can submit.

--Mike

--- In r..., "Guszt Gyi"
wrote:
>
> I forgot to post that I use an RCM4200 and all the bios libs are
factory
> default.
>
> The problem I had with version 10.09 was that I have several nested
> cofunctions in my code, and sometimes they return to the wrong line
> after *yield;
> *like in the following example:
>
> cof_1()
> {
> ...
> wfd {cof_2()}
> ...
> }
> cof_2()
> {
> ...
> wfd {cof_3()} <--instead of returning to this
> statement <--returns to this
> ...
> }
>
> cof_3()
> {
> ...
> yield;
> ...
> }
>
> This of course causes program failure. I confirmed this by execution
tracing
> and single stepping as well. Rabbit tech support asked me for a sample
code
> so they can reconstruct the problem but it's quite difficult since the
> program is very complex and is based on communication with external
devices.
> I spent months with this problem, so any ideas on this are most
welcome as
> well :)
>
> Thanks in advance, Gusztav
> On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi directsl@...
wrote:
>
> > Dear Everyone,
> >
> > I had difficulties with Dynamic C 10.09 so I decided to move to
version
> > 10.21. My problem with this one is, when I get errors during a
compilation
> > and then try to compile anything (including the simplest sample
programs) I
> > get the compiler message:
> >
> > line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg
origin
> > directive.
> > line 38 : ERROR Rabbitbios.c : Out of root code space, try
moving code
> > to XMEM.
> > The only thing I could do is quitting Dynamic C and starting it
again,
> > after that it works ok until the first compilation error. The same
with
> > 10.23 under Win2K and XP as well. Any ideas?
> >
> > Thanks, Gusztav
>
These are bad news... so neither did you find out any solution? Did you
contact tech support? This must be a compiler bug, it should be taken care
of...

Gusztav

On Fri, Jun 27, 2008 at 9:02 PM, Mike wrote:

> Gusztav,
>
> I've experienced the exact same issue in with DC10.21 and an RCM4010
> which basically cost me a return trip to my customer site (grumble
> grumble). The program has three main costates, one of which can nest
> cofuncs up to four levels deep (these cofuncs are fairly simple and
> straightforward code). It was always the deepest cofunc that failed to
> resume at a waitfor statement-- it would resume at the statement after
> the cofunc call instead (which derails things as you might expect). I
> experimented with different constructs at the problem spot-- such as
> using an explicit test and yield and also moving the problem cofunc one
> level deeper but still it failed.
>
> This is a fairly large program (~240KB) which relies on numerous custom
> libraries, so it's not easy to produce a test case I can submit.
>
> --Mike
>
> --- In r... ,
> "Guszt Gyi"
> wrote:
>
> >
> > I forgot to post that I use an RCM4200 and all the bios libs are
> factory
> > default.
> >
> > The problem I had with version 10.09 was that I have several nested
> > cofunctions in my code, and sometimes they return to the wrong line
> > after *yield;
> > *like in the following example:
> >
> > cof_1()
> > {
> > ...
> > wfd {cof_2()}
> > ...
> > }
> >
> >
> > cof_2()
> > {
> > ...
> > wfd {cof_3()} <--instead of returning to this
> > statement <--returns to this
> > ...
> > }
> >
> > cof_3()
> > {
> > ...
> > yield;
> > ...
> > }
> >
> > This of course causes program failure. I confirmed this by execution
> tracing
> > and single stepping as well. Rabbit tech support asked me for a sample
> code
> > so they can reconstruct the problem but it's quite difficult since the
> > program is very complex and is based on communication with external
> devices.
> > I spent months with this problem, so any ideas on this are most
> welcome as
> > well :)
> >
> > Thanks in advance, Gusztav
> > On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi directsl@...
> wrote:
> >
> > > Dear Everyone,
> > >
> > > I had difficulties with Dynamic C 10.09 so I decided to move to
> version
> > > 10.21. My problem with this one is, when I get errors during a
> compilation
> > > and then try to compile anything (including the simplest sample
> programs) I
> > > get the compiler message:
> > >
> > > line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg
> origin
> > > directive.
> > > line 38 : ERROR Rabbitbios.c : Out of root code space, try
> moving code
> > > to XMEM.
> > > The only thing I could do is quitting Dynamic C and starting it
> again,
> > > after that it works ok until the first compilation error. The same
> with
> > > 10.23 under Win2K and XP as well. Any ideas?
> > >
> > > Thanks, Gusztav
> > >
> >
>
Wow. I've already been checking out Mr. Henion's page, how could I possibly
miss this lib? Anyway, I'm going to try this tomorrow. Looks like Scott
Henion saves the day again? Thanks, and I'll report.

Gusztav

On Mon, Jun 30, 2008 at 8:45 PM, Mike wrote:

> One solution is to drop Dynamic C's buggy costates and switch to Scott
> Henion's CoExec library (http://shdesigns.org/rabbit/freelibs.shtml). It
> looks to be a far better solution for cooperative multitasking than
> Dynamic C's costate approach. I have ported my code to use it (which
> only took a few minutes) and the problem is gone. There are other
> benefits too, including less overhead and full source.
>
> --Mike
>
> --- In r... ,
> "Guszt Gyi"
> wrote:
>
> >
> > These are bad news... so neither did you find out any solution? Did
> you
> > contact tech support? This must be a compiler bug, it should be taken
> care
> > of...
> >
> > Gusztav
> >
> > On Fri, Jun 27, 2008 at 9:02 PM, Mike mhoytjr@... wrote:
> >
> > > Gusztav,
> > >
> > > I've experienced the exact same issue in with DC10.21 and an RCM4010
> > > which basically cost me a return trip to my customer site (grumble
> > > grumble). The program has three main costates, one of which can nest
> > > cofuncs up to four levels deep (these cofuncs are fairly simple and
> > > straightforward code). It was always the deepest cofunc that failed
> to
> > > resume at a waitfor statement-- it would resume at the statement
> after
> > > the cofunc call instead (which derails things as you might expect).
> I
> > > experimented with different constructs at the problem spot-- such as
> > > using an explicit test and yield and also moving the problem cofunc
> one
> > > level deeper but still it failed.
> > >
> > > This is a fairly large program (~240KB) which relies on numerous
> custom
> > > libraries, so it's not easy to produce a test case I can submit.
> > >
> > > --Mike
> > >
> > > --- In r... > 40yahoogroups.com>,
> > > "Guszt Gyi" directsl@
>
> > > wrote:
> > >
> > > >
> > > > I forgot to post that I use an RCM4200 and all the bios libs are
> > > factory
> > > > default.
> > > >
> > > > The problem I had with version 10.09 was that I have several
> nested
> > > > cofunctions in my code, and sometimes they return to the wrong
> line
> > > > after *yield;
> > > > *like in the following example:
> > > >
> > > > cof_1()
> > > > {
> > > > ...
> > > > wfd {cof_2()}
> > > > ...
> > > > }
> > > >
> > > >
> > > > cof_2()
> > > > {
> > > > ...
> > > > wfd {cof_3()} <--instead of returning to this
> > > > statement <--returns to this
> > > > ...
> > > > }
> > > >
> > > > cof_3()
> > > > {
> > > > ...
> > > > yield;
> > > > ...
> > > > }
> > > >
> > > > This of course causes program failure. I confirmed this by
> execution
> > > tracing
> > > > and single stepping as well. Rabbit tech support asked me for a
> sample
> > > code
> > > > so they can reconstruct the problem but it's quite difficult since
> the
> > > > program is very complex and is based on communication with
> external
> > > devices.
> > > > I spent months with this problem, so any ideas on this are most
> > > welcome as
> > > > well :)
> > > >
> > > > Thanks in advance, Gusztav
> > > > On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi directsl@
> > > wrote:
> > > >
> > > > > Dear Everyone,
> > > > >
> > > > > I had difficulties with Dynamic C 10.09 so I decided to move to
> > > version
> > > > > 10.21. My problem with this one is, when I get errors during a
> > > compilation
> > > > > and then try to compile anything (including the simplest sample
> > > programs) I
> > > > > get the compiler message:
> > > > >
> > > > > line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg
> > > origin
> > > > > directive.
> > > > > line 38 : ERROR Rabbitbios.c : Out of root code space, try
> > > moving code
> > > > > to XMEM.
> > > > > The only thing I could do is quitting Dynamic C and starting it
> > > again,
> > > > > after that it works ok until the first compilation error. The
> same
> > > with
> > > > > 10.23 under Win2K and XP as well. Any ideas?
> > > > >
> > > > > Thanks, Gusztav
> > > > >
> > > >
> > >
> > >
> > >
> >
>
>
>
One solution is to drop Dynamic C's buggy costates and switch to Scott
Henion's CoExec library (http://shdesigns.org/rabbit/freelibs.shtml). It
looks to be a far better solution for cooperative multitasking than
Dynamic C's costate approach. I have ported my code to use it (which
only took a few minutes) and the problem is gone. There are other
benefits too, including less overhead and full source.

--Mike

--- In r..., "Guszt Gyi"
wrote:
>
> These are bad news... so neither did you find out any solution? Did
you
> contact tech support? This must be a compiler bug, it should be taken
care
> of...
>
> Gusztav
>
> On Fri, Jun 27, 2008 at 9:02 PM, Mike mhoytjr@... wrote:
>
> > Gusztav,
> >
> > I've experienced the exact same issue in with DC10.21 and an RCM4010
> > which basically cost me a return trip to my customer site (grumble
> > grumble). The program has three main costates, one of which can nest
> > cofuncs up to four levels deep (these cofuncs are fairly simple and
> > straightforward code). It was always the deepest cofunc that failed
to
> > resume at a waitfor statement-- it would resume at the statement
after
> > the cofunc call instead (which derails things as you might expect).
I
> > experimented with different constructs at the problem spot-- such as
> > using an explicit test and yield and also moving the problem cofunc
one
> > level deeper but still it failed.
> >
> > This is a fairly large program (~240KB) which relies on numerous
custom
> > libraries, so it's not easy to produce a test case I can submit.
> >
> > --Mike
> >
> > --- In r... ,
> > "Guszt Gyi" directsl@
> > wrote:
> >
> > >
> > > I forgot to post that I use an RCM4200 and all the bios libs are
> > factory
> > > default.
> > >
> > > The problem I had with version 10.09 was that I have several
nested
> > > cofunctions in my code, and sometimes they return to the wrong
line
> > > after *yield;
> > > *like in the following example:
> > >
> > > cof_1()
> > > {
> > > ...
> > > wfd {cof_2()}
> > > ...
> > > }
> > >
> > >
> > > cof_2()
> > > {
> > > ...
> > > wfd {cof_3()} <--instead of returning to this
> > > statement <--returns to this
> > > ...
> > > }
> > >
> > > cof_3()
> > > {
> > > ...
> > > yield;
> > > ...
> > > }
> > >
> > > This of course causes program failure. I confirmed this by
execution
> > tracing
> > > and single stepping as well. Rabbit tech support asked me for a
sample
> > code
> > > so they can reconstruct the problem but it's quite difficult since
the
> > > program is very complex and is based on communication with
external
> > devices.
> > > I spent months with this problem, so any ideas on this are most
> > welcome as
> > > well :)
> > >
> > > Thanks in advance, Gusztav
> > > On Thu, Jun 26, 2008 at 10:45 AM, Guszt Gyi directsl@
> > wrote:
> > >
> > > > Dear Everyone,
> > > >
> > > > I had difficulties with Dynamic C 10.09 so I decided to move to
> > version
> > > > 10.21. My problem with this one is, when I get errors during a
> > compilation
> > > > and then try to compile anything (including the simplest sample
> > programs) I
> > > > get the compiler message:
> > > >
> > > > line 38 : ERROR Rabbitbios.c : Must define at least one #rcodorg
> > origin
> > > > directive.
> > > > line 38 : ERROR Rabbitbios.c : Out of root code space, try
> > moving code
> > > > to XMEM.
> > > > The only thing I could do is quitting Dynamic C and starting it
> > again,
> > > > after that it works ok until the first compilation error. The
same
> > with
> > > > 10.23 under Win2K and XP as well. Any ideas?
> > > >
> > > > Thanks, Gusztav
> > > >
> > >
> >
> >
>

The 2024 Embedded Online Conference