All ChipCon (now TI) CCXXXX 8051 implementations have some form of unified memory architecture.
This means that flash can be read as part of a unified xdata space.
Unified memory allows constants to remain in flash rather than ram.
Whereas placement of the CONST segment by the linker can accommodate this, the following code;
const unsigned b = (unsigned) &a;
Where b is a constant handle to global variable fails to compile (all models).
The reason for this failure is unclear - it generates error 2: Initializer element is not constant
Which is clearly incorrect.
Log in to post a comment.