I wonder that S32144 cookbook Software code contents.
S321xx cookbook shows that, RxCODE = 0x07000000 >> 24; // Read Code field
Then, RX EDL, BRS, ESI have '0x0b' and CODE(27-24 bits) is "0x0111b"
But, Message buffer code for Rx buffers aren't have '0x0111b' CODE
Finally, I think, if 0x07000000 >> 24; means TIMESTAMP position.
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
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
7
In other hands, Tx buffers Table has 0x0C400000 of FLEXCAN0_transmit_msg "1100 CODE data".
I attach photo file too.
Thank you
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
Thanks a lot for your brilliant comments.
I understood it.