S32K1XX S/W contents question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K1XX S/W contents question

427件の閲覧回数
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 件の賞賛
返信
4 返答(返信)

408件の閲覧回数
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 件の賞賛
返信

396件の閲覧回数
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 件の賞賛
返信

386件の閲覧回数
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 件の賞賛
返信

382件の閲覧回数
mumumilmil
Contributor I

Thanks a lot for your brilliant comments.

I understood it. 

0 件の賞賛
返信