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.

4-byte alignment for structures and arrays. (ARM-Cortex-M4F)

Refering to:

LP-XDS110: not able to connect - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E...

e2e.ti.com
Part Number: LP-XDS110 Other Parts Discussed in Thread: UNIFLASH Tool/software: after installing new CCS12.8.1, i am not able to connect XDS110 with any target

I would like to ask what is the recommended method to 4-bytes align data structures (especially static data structures) specifically for TI ARM Compiler.

Also is there a mechanism to force the data structure to occupy a particular address?

  • Safiullah Hussaini said:
    I would like to ask what is the recommended method to 4-bytes align data structures

    From looking at your other thread, I can tell you want to align an array of unsigned char.  There are two methods to consider.  One is the DATA_ALIGN pragma, documented in the TI compiler manual.  The other is the GCC attribute for aligned types documented here.

    Safiullah Hussaini said:
    is there a mechanism to force the data structure to occupy a particular address?

    Yes.  The LOCATION pragma and location attribute are discussed in the TI compiler manual.

    Thanks and regards,

    -George