Marc Adams wrote:
Hi,
I am trying to find a solution to the following scenario:
I have an embedded board which has a small amount of non-volatile
battery backed SRAM. The SRAM is used to store data during system power
fail. Using the GCC compiler is it possible to label a variable to
ensure that it is mapped to the battery backed memory area using a type
modifier?
This is not unlike the functionality offered by the section variable
attribute described in section 5.31 of the GCC manual. Unfortunatley the
to use the section variable attribute the data must be initialized. As I
need to retain data during system power fail the variables can not be
initialized.
Hmm, all staticly allocated data is initialized, it's just some is
zero initialized (and many systems do this by placing them in .bss, which
is zeroed at load time).
Clearly the placement into NVRAM will create an 'odd' executable image --
your boot sequence presumably copies a static data image from ROM to
RAM. Can you disable that for this special section? Another approach
might be to use objcopy to change the attributes of the NVRAM section.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@xxxxxxxxxxxxxxxx :: http://www.planetfall.pwp.blueyonder.co.uk