Can anyone help?
I am creating a simple but long table of RAM addresses in ROM.
static const void* addressTableInROM=
This is fine except each address on the ARM is 32bit
and begins with the same 2 bytes 0x2000, e.g. 0x200009A4. Target is
How can I store this table more efficiently;-
a) in ROM
b) with global persistence
by say storing only the 2 least significant bytes of each address?
Interestingly it is possible to create such a table in RAM
without global persistence like this;-
const unsigned short addressTableInROM=
but putting static before const produces the wrong result that is;-
a) all the entries are 0 and
b) no compiler or linker error is produced.
Also the table is smaller but presumably an initial image goes in ROM.
1 I am using the latest winarm/gnu distribution 06062006 for arm7tdmi
on a ranasonse reva eval board.
2. Casting initialisers is disallowed on other compilers.
3. Arithmetic on pointer initializers is allowed on (older)IAR
4. In the first example above, any cast or arithmetic on the initializer
turns the value to 0.
5. Using Optimizer level 1, .cpp files, no thumb/thumb-interworking.