Structures are overlapping

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KeDa_1385231
Level 1
Level 1

Hi.  I'm using PSoC Creator 3.3 SP2 and the supplied arm gcc compiler.

   

I have some structures which are defined to hold global data.  The structures overlap........  When I clear the memory in 

   

Session[0]->Receive->Data[ .... ]. I wipe out a significant portion of Source

Anybody have any advice? Can't find out about any maximum structure sizes. All optimization settings are turned off.   

// config.h

// this is the main structure for runtime values

struct SourceStr

{

// bunches of stuff

};

struct RingBufferStr

{

      uint8_t Head;

      uint8_t Tail;

      uint8_t Data[256];

};

struct SessionStr

{

      struct RingBufferStr    Transmit;

      struct RingBufferStr    Receive;

};

extern struct SourceStr Source;

extern struct SessionStr Sessions[2];

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your explanation has some conflicts, I cannot see the declaration of "Session" and I cannot see that its member "Receive" is a pointer.

   

Can you please post your complete project or a compilable excerpt that shows the error, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

View solution in original post

0 Likes
1 Reply
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your explanation has some conflicts, I cannot see the declaration of "Session" and I cannot see that its member "Receive" is a pointer.

   

Can you please post your complete project or a compilable excerpt that shows the error, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes