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.

Data Alignment within a structure

Other Parts Discussed in Thread: TEST2

Hello,

I am working on C66XX multicore DSP processor using CCS 5.1.1.00031.

I want to align individual elements of structure by 128 bytes.

For Example:

typedef struct

{

uint8_t array1[20];

uint32_t array2[32];

}Test1_s;

typedef struct

{

uint8_t array3[20];

uint32_t array4[32];

}Test2_s;

typedef struct

{

Test1_s Test1 ;

Test2_s Test2 ;

}Test3_s;

I want to align Test1 and Test2 by 128 bytes.

#pragma DATA_ALIGN (Test2, 128)

#pragma DATA_ALIGN (Test1, 128)

#pragma DATA_ALIGN (gTest, 128)

Test3_s gTest = {0};

But it is not working and showing warning as  :

#837-D pragma can only be applied to a file level symbol, not 'Test1'

#837-D pragma can only be applied to a file level symbol, not 'Test2'

Thanks,

Aman