s32k344 CAN Reception code

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

s32k344 CAN Reception code

3,665 次查看
ash123456789
Contributor III

I am Sending Can msg after receiving Can msg but its sending Can msg without receiving what went wrong 

0 项奖励
回复
5 回复数

3,639 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

change a code little bit...

FlexCAN_Ip_SetStartMode(INST_FLEXCAN_0);
FlexCAN_Ip_ConfigRxMb(INST_FLEXCAN_0, RX_MB_IDX, &rx_info, MSG_ID);

FlexCAN_Ip_Receive(INST_FLEXCAN_0, RX_MB_IDX, &RxData, false);

while(1)
{

      if(FlexCAN_Ip_GetTransferStatus(INST_FLEXCAN_0, RX_MB_IDX) == FLEXCAN_STATUS_SUCCESS)
        {

               FlexCAN_Ip_Send(INST_FLEXCAN_0, TX_MB_IDX, &tx_info, MSG_ID, &RxData);
              FlexCAN_Ip_Receive(INST_FLEXCAN_0, RX_MB_IDX, &RxData, false);
        }

}

This is if receive does not use a polling option. If you want to have pooling one you need to call FlexCAN_Ip_MainFunctionRead to process received frame and update driver status. 
Do not clear MB flag, it is done by driver.

BR, Petr

0 项奖励
回复

3,606 次查看
ash123456789
Contributor III

please help me to find out mistake why its not working

0 项奖励
回复

3,613 次查看
ash123456789
Contributor III
its not working is there any document where it shown step by step how do configure and transmit or receive in both method like polling and intruppt
0 项奖励
回复

3,587 次查看
PetrS
NXP TechSupport
NXP TechSupport
0 项奖励
回复

3,540 次查看
ash123456789
Contributor III
but i am using setup RTD version 5.0.0
and design studio 3.5
this refernce example code is not working in my code
0 项奖励
回复