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.

CC1352R: Implementation of a Union

Part Number: CC1352R

Hi,

IDE CCS Version: 9.3.0.00012 

Compiler: TI v18.12.15

Implementing the next Union:

union
{
unsigned int data;
unsigned short data_1;
unsigned short data_2;
unsigned char data_buf[4];
}u_data;

data_buf [0] = 0xaa;

data_buf [1] = 0xbb;

data_buf [2] = 0xcc;

data_buf [3] = 0xdd;

I expect data to be - 0xddccbbaa and it is correct.

data_1 to be 0xddcc

data_2 to be 0xbbaa

Here is the problem. data_1 == data_2 -> 0xbbaa. In the debuger data_ and data_2 have the same address?

What is the problem

Best regards,

Ilian