On Nov 20, 2010, at 2:53 AM, Peter Bigot wrote: > Dunno. What does __no_init do in IAR? Or, more importantly, what does it do > in TI's example code?
It causes the affected variables to not be initialized at all, based on the IAR documentation I've found. I'm porting the TI USB example code for the MSP430F55xx parts from IAR to mspgcc4, and it applies the __no_init attribute to several structures which are located in the USB buffer memory block. It also uses IAR's "#pragma location" directive to place those structures at specific absolute memory addresses. The IAR reference that I googled up states that the __no_init or const directive must be used along with #pragma location, so I suppose that it's possible that it's not critical for the affected structures in this code to be uninitialized, and the __no_init directive just came along for the ride with the #pragma location directive. I haven't figured out the best way to deal with the #pragma location directives yet. For now, I just made an assembler code file which defines the necessary symbol values (which are declared as extern in the code which uses them), and the linker appears to be ignoring the memory block that they're located in (which can be either a dedicated USB memory buffer, or used as general RAM if the USB hardware is disabled). As long as the linker doesn't try to allocate any other storage overlapping those hard-coded structures, maybe this approach will be ok? On Nov 20, 2010, at 5:22 AM, Chris Liechti wrote: > #define __no_init __attribute__ ((section (".noinit"))) Thank you very much! Is there a reference available which documents attributes like this one that mspgcc4 supports? Is there a reference available which describes how to deal with the various compiler-specific directives that one will need to deal with when porting code between IAR and gcc? Does mspgcc4 have some equivalent of the IAR "#pragma location" directive for placing a variable at a specific absolute memory address? I'm sorry if I'm asking a lot of FAQs here. I've been unable to google up some of the answers I'm looking for so far. -- 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