I had the same problem where an uninitialized segment was zeroed. For proprietary reasons it was best to have that segment have a different name so I used the following in my code:
#define _arbname__ __attribute__ ((section (".arbitraryname"))) int _arbname__ my_array[SIZE_OF_INFO_SEG_A/2]; Then I gave the linker the appropriate command line flags for my segment. something like this: msp430-gcc -mmcu=msp430x449 --section-start \ .arbitraryname=$(begin_of_info_seg_A) [my_objects.o] -o foo.elf I didn't want .arbitraryname to be zeroed every time I loaded it into the program so I did something like this. msp430-objcopy -R .infomem -R .arbitraryname foo.elf This will remove the segments from the binary but my_array[] will still point to that area in memory. Objcopy complains to me sometimes about how I may not want this but I do so it ignore it. Also you may want the -I and -O flags if you are inputting or outputting different file types. I hope this helps. :) -Chris Takahashi -----Original Message----- From: Vladimir Voroncov [mailto:vladi...@design2000.com.au] Sent: Tuesday, July 29, 2003 7:33 PM To: mspgcc-users@lists.sourceforge.net Subject: [Mspgcc-users] NV data area creation Hi all First to answer my own querry from 21/7/2K3 regarding the problem with MSP430-insight.exe stoped working. To cut the long story short...there was an alledged missmatch between XP, cygwin and mspgcc-20030506.exe ( cygwin1.dll wasn't the issue.....). Brute solution in my case was to remove the whole cygwin and than install 20030506 exe clean. Insight.exe GUI worked ( and still works) as intended. (Didn't have time to find exactly what the problem is.....) New "problem": Looks like my application ( with x449) will need a possibly large address translation table which is changing dynamicaly ( reguired to work with Samsung NAND-Flash and his bad blocks..) and should be retained between code reloads. I am aware of __attribute__ ((section(".noinit"))) but will like to avoid copying into RAM because of size reasons. I was also experimenting with __attribute__ ((section (".arbitrary name"))) and locating that into Information Memory segment A ( 0x1080) for example. That was loaded with CSPY and Erase Only Main mem ( not the Info mem) before download option. It looks like that puts zeros into area of choice ( or initial value if provided in the code...) on every reload instead of retaining the area intact? Looks like I need to modify the Linker Script (msp430x449.x..etc..) and /or make my own loader but I am not shore on details ( reading the docs at the moment...). Any advice / hint / recomendation on how to have NV area in the FLASH without RAM usage which is fully accesible from the code and retainable between code reloads is highly appreciated at this point !!!!!! Thanks & Regards Vladimir Voroncov System/Software Engineer Design2000 Pty. Ltd. 9-11 Rose Street PO Box 7020 Upper Ferntree Gully Melbourne Victoria 3156 Australia Phone: -61-(0)3-9758-5933 Fax: -61-(0)3-9758-7279 Mobile: 0407-766-569 Email: vladi...@design2000.com.au