Hello
I've one struct in a header file - but I'm not able to change the values of the struct members.
typedef struct { unsigned int Addr; // unsigned int status; // } *p_Descriptor;
#define RxPacket (0x21000000 + (8 * NB_PACKETS))
0x21000000 is the start addr of a external SRAM.
In the c-file I define a global struct ptr:
volatile p_Descriptor const p_rxBD = (p_Descriptor)0x21000000;
In a local function I want to fill the struct array.
char *pPacket =(char *)RxPacket;
for(i=0; i< NB_PACKETS; i++) { p_rxBD[i].Addr = (unsigned int)pPacket; // p_rxBD[i].status = 0; pPacket +=SIZE; }
but I'm not able to do this. If i watch the values of the struct (with the watch window) - the value of the ptr is 0x21000000 (which is ok and his addr is 0x20000010 (internal sram) which is also ok)
But the values of Addr is 0xFFFFFFFF and the value of status is 0x6000FFFF - and these values didn't change during the for loop. I step through the programm but this values are always the same value.
I don't no if it is correct that the value of *p_RxBD is 0x21000010 and the ptr **p_rxBD is 0x21000D90 --> because this area is only for the buffers of the peripherial and not for a ptr. Therefore I installed this ptr in the internal RAM and p_rxBD has the addr 0x20000010 which is correct...
Johannes