1 Reply Latest reply on Jun 3, 2016 12:38 PM by user_1377889

    Structures are overlapping

    user_515762956

      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];

        • 1. Re: Structures are overlapping
          user_1377889

          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