Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
Doubt : Default value of Variables which are kept in NO_INIT location - yadunandan kasu - Jan 24 11:44:30 2008
hi everyone,
can any one tell me the initial default value for the varibles
which are placed in the NO_INIT location by modifying the .prm file. I
am using Codewarrior for this.
I modifed my project .prm file, like below using NO_INIT, so
that the variables which are declared in the RAM area from 0x2000 to
2005 will not be initialized to zero by default.
when I download the code and debugging, I found it carries a max
value by default initially. (i.e if I declare a char variable, it
carries a value of 254).
That means, all the variables which are declared in this RAM
area will carry their max values...? or is that 254 is any garbage
value..?
please provide me the answer..
/* non-paged RAM */
My_Ram_Non_Init = NO_INIT 0x2000 TO 0x2005; /* vairbles in this
location will not be
initialized to zero */
My_Ram = READ_WRITE 0x2006 TO 0x3FFF;
Thanks & Regards
Kasu

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Doubt : Default value of Variables which are kept in NO_INIT location - Daniel Friederich - Jan 25 19:28:57 2008
Hi Kasu,
Is this for a S12X?
Variables allocated in NO_INIT segments are not written to by the
startup code, therefore the values are
either garbage, values written into it before or some otherwise by the
hardware defined values.
For RAM and after the power on startup, I would expect them to contain
garbage.
Daniel
yadunandan kasu wrote:
> hi everyone,
>
> can any one tell me the initial default value for the varibles
> which are placed in the NO_INIT location by modifying the .prm file. I
> am using Codewarrior for this.
>
> I modifed my project .prm file, like below using NO_INIT, so
> that the variables which are declared in the RAM area from 0x2000 to
> 2005 will not be initialized to zero by default.
>
> when I download the code and debugging, I found it carries a max
> value by default initially. (i.e if I declare a char variable, it
> carries a value of 254).
> That means, all the variables which are declared in this RAM
> area will carry their max values...? or is that 254 is any garbage
> value..?
>
> please provide me the answer..
>
> /* non-paged RAM */
>
> My_Ram_Non_Init = NO_INIT 0x2000 TO 0x2005; /* vairbles in this
> location will not be
> initialized to zero */
> My_Ram = READ_WRITE 0x2006 TO 0x3FFF;
> Thanks & Regards
> Kasu
>
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Doubt : Default value of Variables which are kept in NO_INIT location - kasu nandu - Jan 28 6:34:40 2008
Hi Daniel,
I agree with you,^^
I think the all the variables defined in the NO_INIT location carries some garbage
value.
I checked by defining different variables in the NO_INIT locations in my project.
Thank you very much~
Kasu
Daniel Friederich
wrote: Hi Kasu,
Is this for a S12X?
Variables allocated in NO_INIT segments are not written to by the
startup code, therefore the values are
either garbage, values written into it before or some otherwise by the
hardware defined values.
For RAM and after the power on startup, I would expect them to contain
garbage.
Daniel
yadunandan kasu wrote:
> hi everyone,
>
> can any one tell me the initial default value for the varibles
> which are placed in the NO_INIT location by modifying the .prm file. I
> am using Codewarrior for this.
>
> I modifed my project .prm file, like below using NO_INIT, so
> that the variables which are declared in the RAM area from 0x2000 to
> 2005 will not be initialized to zero by default.
>
> when I download the code and debugging, I found it carries a max
> value by default initially. (i.e if I declare a char variable, it
> carries a value of 254).
> That means, all the variables which are declared in this RAM
> area will carry their max values...? or is that 254 is any garbage
> value..?
>
> please provide me the answer..
>
> /* non-paged RAM */
>
> My_Ram_Non_Init = NO_INIT 0x2000 TO 0x2005; /* vairbles in this
> location will not be
> initialized to zero */
> My_Ram = READ_WRITE 0x2006 TO 0x3FFF;
> Thanks & Regards
> Kasu

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )