This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: Ram-Adress problems with onion

Part Number: TMS320F28379D

Hello all,
I have a problem with the ram location. I have created an onion for a communication (first interprocessor and then over SPI) which contains once the sorted data as struct and once the data as array.
However, the memory locations do not match. At a RAM address a value is stored in the array which is not contained in the struct. I have made a screenshot of it and started.



Does anyone have an idea what causes this and how I can fix it?

best regards
Leon

  • Leon,

    I've assigned your post to one of our team members, please expect a reply by tomm, 2/22 as we are out of the office for the President's Day holiday in the US today the 21st.

    Best,

    Matthew

  • Leon,

    Sorry for the delay on our side.  Due to the architecture of the C2000 CPU the linker is aligning 32-bit data to even addresses, since the long "Datacount" follows a single int "seite" I believe the compiler is inserting an intentional hole at location 5 to achieve this. 

    Could you use the reference of Datacount to index into the Char array?  I will ask some others if there is a more elegant soln here.

    Best,
    Matthew

  • Does anyone have an idea what causes this

    All of the 32-bit wide members of the structure must be aligned on a 2 word boundary.  If necessary, holes appear between members to achieve this alignment.  For further details, please search the C28x compiler manual for the sub-chapter titled Field/Structure Alignment

    how I can fix it?

    If it is practical, change to order of the fields in the structure.  If that is not practical, then I don't see a solution.

    Thanks and regards,

    -George