G'Day Folks, I don't know whether I am addressing exactly what you are trying to do, but I wanted to use the information memory but not initialise it on each flash program so that some data would survive both reboots and flash updates. I defined an array thus:
u16_t __attribute__((section(".infomem"))) info_buffer[32]; then set the options for objcopy thus: OBJCOPY_FLAGS = -O ihex --remove-section=.infomem $(BASE_NAME).elf $(BASE_NAME).hex This has the effect of not including any of the data for the .infomem section in the hex file, so my array info_buffer is not initialised. Can this mechanism be pressed into service for your problem? Graeme > -----Original Message----- > From: mspgcc-users-ad...@lists.sourceforge.net > [mailto:mspgcc-users-ad...@lists.sourceforge.net]on Behalf Of Dmitry > Sent: Thursday, 6 February 2003 18:30 > To: mspgcc-users@lists.sourceforge.net > Subject: Re: [Mspgcc-users] Proposal for a new little, but convenient > feature to ld... > > > Well Oleg, > > actually my idea of .noinit section was to create a section where > variables > not being touched at all. So, initially I wasn't thinking about > allocate them > in ROM. > > Anyway, I agree they should (might) be initialized. > > However, I think that the particular address of the variable (var) can be > found as: > disp1 = &var - __noinit_start; > var_addr_in_rom = disp1 + __noinit_start_rom > hm... exactly as yours :) > Ok then... > > in NoinitDefault(v) you should explicitly refer to the variable > address - &v. > > Ok, I add this function to libc later on tonight. > > Also, there is a function 'int __init_sections_(int section)' which inits > section at request. > > > (elf32msp430.sc, elf32msp430_3.sc) > > > > PROVIDE (__noinit_rom_offset = _etext + SIZEOF > (.data)-__noinit_start ) ; > > You cannot refer to __noinit_start as this is not defined until the final > linker stage. Use ADDR(.noinit) instead. > > cheers, > ~d > Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users