I created a structure about data fields, which are located in a structure in xdata area. The informal structure itself should be in code area.
typedef struct { unsigned char *pucRamAddr; eNvmDevice eDeviceId; // enum type unsigned short tNvmAddr; unsigned short tLength; unsigned char code *pucRomDefaults; char ucFlags; } TNvmBlock; extern const TNvmBlock code tNvmBlock[NVM_BLOCK_COUNT];
Selected model is LARGE. Size of TNvmBlock is usually 11.
So pucRamAddr should point to the element within the xdata structure:
But after linking with BL51 at the pointer entry there is only the Offset within the xdata Structure, the added base address is missing.
I tried to define pucRamAddr as xdata pointer, but then the size of the struct was reduced to 10, although the pucRamAddr were still 2 Byte ???
unsigned char xdata *pucRamAddr;
The pointer target itself were defined like &(tStruct.Element)
Why doesn't the linker fill in the correct xdata address of the Element? And why schrinks the structure size somewhere else when I define the pointer as xdata * ?
Yes - I was including that in, "...provide code to make it so".
You didn't show or mention any initialisation in your initial post.
Anyhow - glad is fixed now!
:-)