Can_tx_rx same time

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

Can_tx_rx same time

1,386件の閲覧回数
intern_praveena
Contributor II

How can transmit and receive at a time?? I am using CAN_PAL.Here is my code,CAN any one help me??

/*************************************/

CAN_Init(INST_CAN_PAL1, &can_pal1_Config0); //CAN intialize

can_buff_config_t tx_buff = {
.enableFD = false,
.enableBRS = true,
.fdPadding = 0U,
.idType = CAN_MSG_ID_EXT,
.isRemote = false
};

CAN_ConfigTxBuff(INST_CAN_PAL1,0,&tx_buff);

can_message_t tx_msg = {
// .cs = 0U,
.id = 0x01,
.data[0] = 0x02,
.data[1] = 0x04,
.data[2] = 0x08,
.length = 3
};
can_buff_config_t rx_buff = {
.enableFD = 0,
.enableBRS = true,
.fdPadding = 0U,
.idType = CAN_MSG_ID_EXT,
.isRemote = false
};

CAN_ConfigRxBuff(INST_CAN_PAL1,0,&rx_buff,1);

can_message_t rx_msg = {
//.cs = 0U,
.id = 1,
.length = 2

};

while(1)
{
CAN_Send(INST_CAN_PAL1,0,&tx_msg);
CAN_Receive(1,0,&rx_msg);

}

/****************************************/

0 件の賞賛
返信
2 返答(返信)

1,238件の閲覧回数
alexandrunan
NXP Employee
NXP Employee

On which chip and what sdk version you use ?

Second what configuration was applied to CAN_Init ? Because from your configuration of tx message buffer is something not right, becasue brs and fd must be enable else the function will return status error. in your code first I suggest to check the function status return in case something is wrong or missconfigured. 

And the major issue is that the Pal function requires a structure as parameter that identify the structure type and instance number not a macro defined as symbol for instance no. 

CAN_Init(INST_CAN_PAL1, &can_pal1_Config0);

This is correct only if you defined the symbol INST_CAN_PAL1 as address to the structure.

0 件の賞賛
返信

1,238件の閲覧回数
vinothkumars
Senior Contributor IV

Praveena,

What is the result, did you check send and receive separately?

Is there any packet loss, which address mode and what is the frequency?

Please provide the full file also.

Regards,
Vinothkumar Sekar
0 件の賞賛
返信