s32k344 CAN Reception code

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

s32k344 CAN Reception code

2,504 Views
ash123456789
Contributor III

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

0 Kudos
Reply
5 Replies

2,478 Views
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 Kudos
Reply

2,446 Views
ash123456789
Contributor III

please help me to find out mistake why its not working

0 Kudos
Reply

2,453 Views
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 Kudos
Reply

2,427 Views
PetrS
NXP TechSupport
NXP TechSupport
0 Kudos
Reply

2,380 Views
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 Kudos
Reply