FlexCAN S32K344 Polling

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

FlexCAN S32K344 Polling

967 Views
Samuel_DCosta
Contributor III

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 

Samuel_DCosta_0-1723710728635.png

as compared to 

Samuel_DCosta_1-1723710782963.png

What am I missing here?

The behaviour is the same if FlexCAN_Ip_GetTransferStatus is commented.

Tags (1)
0 Kudos
Reply
1 Reply

938 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply