I used this example as a base and modified it for S32k344
Example S32K312 CAN Transmit & Receive Using Polling mode DS3.5 RTD300 - NXP Community
I do not see a difference if I have the code as
as compared to
What am I missing here?
The behaviour is the same if FlexCAN_Ip_GetTransferStatus is commented.
Hi @Samuel_DCosta,
Are you testing the project with two nodes (two boards or one board and a CAN analyzer)? If using an analyzer, please confirm if the speed and sampling point are correct, as well as all the other configuration values.
The GetTransferStatus function is used in polling applications, since it returns either true or false depending on if the last FlexCAN transfer was successful. This is why polling is set to true, and the MCU waits until successful transfer before reading a response:
FlexCAN_Ip_Send(INST_FLEXCAN_0, TX_MB_IDX, &rx_info, MSG_ID, (uint8 *)&dummyData);
// Polling
while(FlexCAN_Ip_GetTransferStatus(INST_FLEXCAN_0, TX_MB_IDX) != FLEXCAN_STATUS_SUCCESS)
{
FlexCAN_Ip_MainFunctionWrite(INST_FLEXCAN_0, TX_MB_IDX);
}
You can skip the polling if using interrupts. You can also use the following community posts as reference:
The last one is based on RTD 2.0.0, but it can be ported into the newest releases by copying the configuration.
Best regards,
Julián