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.
Tool/software: TI C/C++ Compiler
Hy,
maybe a stupid problem but is first time I faced it,
it regards a struct, defined in this way
typedef struct fttethernet_frame
{
uint16 vlan_tag; // 0x60, 0x0a,
uint8 message_id; // 0x02
uint16 frame_length; // 0x01, 0x00
}fttethernet_frame_t;
the values in the comments describe how I load it with a test array:
static const uint8 pkt1[60] = {
0x60, 0x0a, // vlan_tag
0x02, // message_id
0x01, 0x00 // frame_length
};
the result of the following instruction is unpredicatable for me
fttethernet_frame_t *frame_rx;
frame_rx = (fttethernet_frame_t *)pkt1;
in fact I've the following:
can you tell why frame_length is 0x0000 instead of 0x0100 ?
Thanks
Antonio
I'm not certain, but I suspect your code does not account for the 1-byte of alignment padding between the fields message_id and frame_length. If you want to avoid this padding, used packed structures. Read more about that feature in the ARM compiler manual section titled Type Attributes.
Thanks and regards,
-George