MPC5645S CAN communication and endianess

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5645S CAN communication and endianess

591 Views
ino0
Contributor II

Hello,

I am a little confused about endianess when I use CAN communication in MPC5645S.

My question is, when I receive a CAN frame with 8 bytes(frameData), I try to receive it by  'unsigned char data[8]'.

Do I need consider endianess here,

Data[0] = frameData[0];

Data[1] = frameData[1];

...

or I should do it like this:

Data[7] = frameData[0];

Data[6] = frameData[1];

...

Labels (1)
1 Reply

494 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the message buffer structure is following, valid for both RX and TX operation.

pastedImage_1.png

The receive frame is stored into the MB as shown in above picture.

So it depends how the MB was prepared on opposite node, user then read the received message as needed.

BR, Petr