S32K144 FlexCan receiving mailbox can receive data from sending mailbox

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K144 FlexCan receiving mailbox can receive data from sending mailbox

跳至解决方案
1,051 次查看
TM_207
Contributor I

hello:

I use the example S32K144_ Project_ FlexCan downloaded from the official website,.FlexCan example path: S32K1xx_ cookbook\Examples\S32K144_ Project\S32K144_ Project_ FlexCan, use CAN0 mailbox 0 to send data and CAN0 mailbox 4 to receive data. Query the receive flag of mailbox 4 in the mian function. If the receive flag bit of mailbox 4 is equal to 1, use mailbox 0 to send a frame of data. Mailbox 4 receives CAN-ID of 0x511, and mailbox 0 sends CAN-ID of 0x555

Question:

When I use the pointer variable to receive the CANID number and modify the sending ID in the sending function at the same time, the receiving mailbox can receive the data of the sending mailbox, resulting in the receiving flag bit of mailbox 4 being equal to 1.

15204692296_0-1677649220327.png

15204692296_1-1677649235331.png

15204692296_2-1677649247310.png

15204692296_3-1677649429603.png

 

If I do not modify the following statement in the send function, the receiving mailbox cannot receive the data of the sending mailbox.

CAN0->RAMn[ 0*MSG_BUF_SIZE + 1] = 0x15540000; /* MB0 word 1: Tx msg with STD ID 0x555 */

Attached are codes

 

 

0 项奖励
1 解答
1,036 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

set MCR[SRXDIS] bit

PetrS_0-1677652651013.png

BR, Petr

在原帖中查看解决方案

2 回复数
1,037 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

set MCR[SRXDIS] bit

PetrS_0-1677652651013.png

BR, Petr

1,024 次查看
TM_207
Contributor I
Thank you. I know the reason for my error, because the CAN-ID number I sent and received is the same. If the CAN-ID I sent is not within the received CAN-ID number, this problem will not occur
0 项奖励