To expand on what Chris said:
The .noinit section is an alias for the .infomemnobits section.
Using __attribute__((section(".infomem"))) causes the storage for the
variable to be placed in one of the MCU's information memory blocks. In the
current implementation, there are two: .infomem is a catenation of two or
four blocks, depending on chips, that is marked for initialization. This
allows you to place, for example, a state structure in non-volatile memory
and provide an initial value for it. If no global initializer is present,
then the object file incorporates zeros to initialize it.
.infomemnobits is an alternative section that is supposed to overlay
.infomem, but does not include initial data in the object file. This might
be appropriate for things like the information memory sections on old
devices that contained chip-specific calibration constants (these are now
stored in the TLV structures), or application data that should survive a
firmware update. Building a program that mixes .infomem and .infomemnobits
assignments results in undefined behavior.
Thus, there are really two distinct issues: preventing initialization of the
memory (either at the time the image is programmed, if in flash, or at
power-on-reset, if in RAM) and placing the variable into memory (either at
an arbitrary location in the data region of flash, with the section infomem
attribute, or at a specific address using the asm syntax).
If you use asm statements to place variables in RAM, that region will be
zeroed on a power-on-reset, along with the rest of RAM. Perhaps the IAR/CCS
__no_init directive is intended to inhibit this. If so, I don't believe
msp430 gcc has an equivalent capability.
I was peripherally (hah!) aware that the MSP430 chips with USB support
overload parts of RAM to use for USB structures. I have not yet added
explicit support for that. Perhaps offline we can talk about the details,
and I'll add that feature in the uniarch updates, which are much more
friendly to supporting chip-specific memory layouts.
(BTW: The specific syntax for placing variables in information memory will
be enhanced in uniarch, as I want to be able to identify individual
information memory sections, allowing you to have some that are initialized
and some that are not. I'll be as backwards-compatible as I can, but one
enhancement is likely to be that nobits will be a separate attribute from
the section attribute, so we don't have to have two linker sections defined
for each flash memory block.)
Peter
On Sat, Nov 20, 2010 at 12:47 PM, Mark J. Blair <n...@nf6x.net> wrote:
>
> On Nov 20, 2010, at 10:40 AM, Chris Liechti wrote:
> > positioning variables is also quite easy:
> >
> > int im_in_infomem_on_a_2xx asm("0x1000");
> >
> > but this will not work with initialized variables.
>
> Aha! I'll give that a try. I found that my first attempt with symbols
> defined in a little .S file works well enough to let the device enumerate on
> the USB bus (yay!), but I'll see if I can get handle things more cleanly
> this way. Thanks! I'll continue to dig in to the linker operation, since I
> still have a lot to learn about how it maps things to memory.
>
>
> --
> Mark J. Blair, NF6X <n...@nf6x.net>
> Web page: http://www.nf6x.net/
> GnuPG public key available from my web page.
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users