DSPRelated.com
Forums

A simple but important problem???????????????

Started by ahma...@yahoo.com March 24, 2008
Dear group
1-In Code composer when I change the init model method in linker tab of build option from "run time initialization" to "load time initialization" at the load time of my .out file to DSP, it shows the data verification error on ".idata0" section while this section is not defined in my cmd file and map file. in the "run time auto initialization" load action is done correctly.
What is the differences between auto initializaton modes? I compared the produced map files and saw that they are the same exept that in runtime mode one page of my Programe page is used while in load time mode it does not used. This page contains CINIT section information.

2- When I initialize one of the arrays in my code as following:
int A[]={1,2,4,5,7};
it works in "volume.c" from tutorials example; but when I use this line in other project which is big (more than one page), it does not initilized the array? Do you know why?

please describe the reason and introduce a proper reference.

Regards
Ahmad-

> 1-In Code composer when I change the init model method in linker tab of build option from "run time initialization" to
> "load time initialization" at the load time of my .out file to DSP, it shows the data verification error on ".idata0"
> section while this section is not defined in my cmd file and map file. in the "run time auto initialization" load
> action is done correctly.
> What is the differences between auto initializaton modes? I compared the produced map files and saw that they are the
> same exept that in runtime mode one page of my Programe page is used while in load time mode it does not used. This
> page contains CINIT section information.
>
> 2- When I initialize one of the arrays in my code as following:
> int A[]={1,2,4,5,7};
> it works in "volume.c" from tutorials example; but when I use this line in other project which is big (more than one
> page), it does not initilized the array? Do you know why?
>
> please describe the reason and introduce a proper reference.

To give you a brief answer, run-time initialization means that C code is responsible for initializing itself when it
first runs. If you declare things like:

static int x = 10;
int A[] = {1,2,4,5,7};
const char str[20] = "ask the group";

then these will be initialized by low-level "boot functions" before code in main() function runs.

If you choose load-time initialization, then CCS does all static, const, and other initialization at the same time as
code is downloaded.

One big difference is obvious: if you download code using load-time init, then run it more than once (starting from
_c_int00 entry-point), on the second time static variables will be left "as is" and not re-initialized. Another
difference is that run-time initialization takes more memory space to hold init tables.

>From these hints you can study more. The subject of run-time vs. load-time init is explained in detail in many TI
docs. They are easy to find if you Google TI's site for "run-time initialization".

-Jeff
Ahmad-
> thanks for answer;I wanted to reply in group; Bu I could not find my and your
> related messages in group. how can I find them?

I think you just go to http://www.groups.yahoo.com/code-comp (or
http://www.groups.yahoo.com/c54x), log-in, and search the archive. I might be
missing something, but it should not be much harder than that.

Another thing you can do is use Google to search the dsprelated.com site with your
keywords. dsprelated.com has all Yahoo DSP groups and comp.dsp messages.
> I know that the boot.obj of rts.lib do initialization but as I said in my big code
> (8 * 32KW) I divided the text and cinit and some other sections to more than one
> page and there auto initialization does not work properly. it may be because of CST
> framework. I do not know why my CCS could load .out to DSP in "run time
> initialization" but not in "load time initialization"?? It send data
> verification error in "idata0" and so on sections. As I see in the forum you could
> not find documentation about "idata". What about now?

Ahmad I don't know. You'll have to debug this. One thing I can say is I don't think
it's a good idea to put the .cinit section int into extended page (far) memory. That
would require the autoinit() function (in boot.obj) to be aware of extended memory
and use special instructions to access it as data memory (TABLR, TABLW). Probably
better to arrange your .cmd file to put .cinit in mem below 64k and move executable
code into far mem.

-Jeff
> Jeff Brower wrote:
>
> Ahmad-
>
> > 1-In Code composer when I change the init model method in linker tab of
> build option from "run time initialization" to
> > "load time initialization" at the load time of my .out file to DSP, it
> shows the data verification error on ".idata0"
> > section while this section is not defined in my cmd file and map file.
> in the "run time auto initialization" load
> > action is done correctly.
> > What is the differences between auto initializaton modes? I compared
> the produced map files and saw that they are the
> > same exept that in runtime mode one page of my Programe page is used
> while in load time mode it does not used. This
> > page contains CINIT section information.
> >
> > 2- When I initialize one of the arrays in my code as following:
> > int A[]={1,2,4,5,7};
> > it works in "volume.c" from tutorials example; but when I use this line
> in other project which is big (more than one
> > page), it does not initilized the array? Do you know why?
> >
> > please describe the reason and introduce a proper reference.
>
> To give you a brief answer, run-time initialization means that C code is
> responsible for initializing itself when it
> first runs. If you declare things like:
>
> static int x = 10;
> int A[] = {1,2,4,5,7};
> const char str[20] = "ask the group";
>
> then these will be initialized by low-level "boot functions" before code
> in main() function runs.
>
> If you choose load-time initialization, then CCS does all static, const,
> and other initialization at the same time as
> code is downloaded.
>
> One big difference is obvious: if you download code using load-time init,
> then run it more than once (starting from
> _c_int00 entry-point), on the second time static variables will be left
> "as is" and not re-initialized. Another
> difference is that run-time initialization takes more memory space to
> hold init tables.
>
> From these hints you can study more. The subject of run-time vs.
> load-time init is explained in detail in many TI
> docs. They are easy to find if you Google TI's site for "run-time
> initialization".
>
> -Jeff
>
Jeff;
thanks for answer;
I wanted to reply in group; Bu I could not find my and your related messages in group. how can I find them?
I know that the boot.obj of rts.lib do initialization but as I said in my big code (8 * 32KW) I divided the text and cinit and some other sections to more than one page and there auto initialization does not work properly. it may be because of CST framework.

I do not know why my CCS could load .out to DSP in "run time initialization" but not in "load time initialization"?? It send data verification error in "idata0" and so on sections. As I see in the forum you could not find documentation about "idata". What about now?
Ahmad

Jeff Brower wrote:
Ahmad-

> 1-In Code composer when I change the init model method in linker tab of build option from "run time initialization" to
> "load time initialization" at the load time of my .out file to DSP, it shows the data verification error on ".idata0"
> section while this section is not defined in my cmd file and map file. in the "run time auto initialization" load
> action is done correctly.
> What is the differences between auto initializaton modes? I compared the produced map files and saw that they are the
> same exept that in runtime mode one page of my Programe page is used while in load time mode it does not used. This
> page contains CINIT section information.
>
> 2- When I initialize one of the arrays in my code as following:
> int A[]={1,2,4,5,7};
> it works in "volume.c" from tutorials example; but when I use this line in other project which is big (more than one
> page), it does not initilized the array? Do you know why?
>
> please describe the reason and introduce a proper reference.

To give you a brief answer, run-time initialization means that C code is responsible for initializing itself when it
first runs. If you declare things like:

static int x = 10;
int A[] = {1,2,4,5,7};
const char str[20] = "ask the group";

then these will be initialized by low-level "boot functions" before code in main() function runs.

If you choose load-time initialization, then CCS does all static, const, and other initialization at the same time as
code is downloaded.

One big difference is obvious: if you download code using load-time init, then run it more than once (starting from
_c_int00 entry-point), on the second time static variables will be left "as is" and not re-initialized. Another
difference is that run-time initialization takes more memory space to hold init tables.

>From these hints you can study more. The subject of run-time vs. load-time init is explained in detail in many TI
docs. They are easy to find if you Google TI's site for "run-time initialization".

-Jeff