We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
is it true, that the watch window does not work properly?
I have one question in my code, where I find out if a variable has the right value -> if not I set a breakpoint to notice that
if(COM1_1 != AT91C_BASE_US1) breakpoint--> i++;
If this breakpoint is aktiv (so the variable should be another value), I didn't see that in the watch window. Here has the value always the right value of the beginning (no change in the symbol window too).