S32K1XX S/W contents question

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

S32K1XX S/W contents question

488 Views
mumumilmil
Contributor I

I wonder that S32144 cookbook Software code contents.

S321xx cookbook shows that, RxCODE = 0x07000000 >> 24; // Read Code field

1.png

 Then, RX EDL, BRS, ESI have '0x0b' and CODE(27-24 bits) is "0x0111b"

2.png

But,  Message buffer code for Rx buffers aren't have '0x0111b' CODE

3.png

 

Finally, I think, if 0x07000000 >> 24; means TIMESTAMP position.

1.png

0 Kudos
Reply
4 Replies

469 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

code is correct. The 0x07000000 is mask for bit AND to get just CODE field from CS word, which is then shifted right by 24 bits to obtain just CODE field.

BR, Petr

0 Kudos
Reply

457 Views
mumumilmil
Contributor I

I found out that your intention.

But, That RxCODE 0x07000000 of FLEXCAN0_receive_msg means '0b0111'

Message buffer code for Rx buffers Table didn't have '0b0111' data. // 0b0111 is not equal to Mask

74.png

5.png

 

In other hands, Tx buffers Table has 0x0C400000 of FLEXCAN0_transmit_msg "1100 CODE data".

6.png

 

I attach photo file too.

 

Thank you

0 Kudos
Reply

447 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you do not get 0b0111 in RxCODE using this code.
RxCODE = (CAN0->RAMn[ 4*MSG_BUF_SIZE + 0] & 0x07000000) >> 24; /* Read CODE field */
It reads full 32bit CS word, do AND operation with 0x07000000 mask, and shift right. 
You simply got content of CODE field.
Ideally mask should be 0x0F000000, but after successful reception there could be either FULL or OVERUN.

BR, Petr

 

0 Kudos
Reply

443 Views
mumumilmil
Contributor I

Thanks a lot for your brilliant comments.

I understood it. 

0 Kudos
Reply