This Technical Note discusses how to place an array of pointers at a specific address.
In an IAR C/C++ Compiler version, which supports @ placement, there are two methods to use. Either declare the array as const or if values needs to be change at run-time declare the array as non-initialized.
unsigned char * const RamAddresses @ 0x8000 =
This method needs two actions.
The absolute placement (@ symbol) does not allow initialized non-const variables. So declare the array as __no_init.
__no_init unsigned char * RamAddresses @ 0x8000;
Then in application code initialize the array, for example at the beginning of main().
RamAddresses = &object1;
RamAddresses = &object2;
RamAddresses = &object3;
RamAddresses = &object4;
All product names are trademarks or registered trademarks of their respective owners.