mailbox

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

mailbox

1,905 Views
guochunhua
Contributor II

Hi.

     Excuse me. in codewarriro 10.7, the MCU is 56f84789, in can interrupt communication, if there is several mailbox to send data, how can I judge the data received is sent by which mailbox? thanks a lot.

     在can 通信中,接收数据时,如何判断是哪个mailbox通过中断发送过来的数据?

 

 

Best regards.

Guo chunhua

Labels (1)
0 Kudos
3 Replies

1,109 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, ChunHua,

Based on CAN Bus protocol, the CAN module of MC56F84789 does not receive the data which the same CAN module transmit if you do not use loop-back mode, because it is meaningless. The CAN module of MC56F84789 receives the data only if the ID is matched, it does not matter which mailbox send the CAN packet, in other words, the CAN receiver does not care about which mailbox send the data for transmitter side.

Hope it can help you

BR

XiangJun Rong

0 Kudos

1,109 Views
guochunhua
Contributor II

Hi Xiangjun

       Thank you for your help. there are two mailbox in my system, if the receive interrupt is coming,how can I judge which maibox is coming.

       系统中没有使用loop-back mode,使用的是周立功的usb-can模块来发送和接收数据,由于实际系统中电机控制器所接收的ID 号不是唯一的,有多个ID号的数据需要接收,这样如果只开一个mailbox的话,若外部连续发送多帧数据的话,如果内部mailbox不能及时处理数据,就可能会丢失数据,这样我就多开一个mailbox,但是中断来了,我不知道是哪个mailbox接收的数据,因而无法正确使用CAN1_ReadFrame()函数,主要原因是该函数的第一个参数需要指明是哪个mailbox,而我不知道是哪个mailbox接收的数据,故该函数我无法正确使用。

Best regards.

Guo chunhua

0 Kudos

1,109 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, ChunHua,

I think it is okay to use two mailboxes to receive data. If you want to know which mailbox has received data, you can call the

CAN1_GetStateRX(void)  api function to get the index of mailbox, then call the CAN1_ReadFrame()函数, while uses the index as input parameter.

Hope it can help you

BR

XiangJun Rong

0 Kudos