I’m using NXP’s MBDT for S32K344 for configuring FlexCAN0. I want to understand what part of CAN message handling is managed by the NXP blocks/toolbox and what needs to be handled by the application.
Please clarify what is handled internally vs. what we must handle in the application.
Solved! Go to Solution.
Hello,
How many messages do you think you need to transmit at one time?
I've tested on a S32K358 HVBMS reference design the following scenario:
The results:
As expected, the first messages sent are with low priority, as the message buffer is not completely populated. Around the 6th message, the buffer is populated and we can see that the messages with higher priority are sent first.
Since you want to use a single transceiver, it is not really possible to simultaneously send all the messages at the same time.
Best regards,
Sorin Bancila
Hello,
First of all, I want to point out that the MBDT for S32K3xx is build on top of the S32K3 RTD. The configuration of a peripheral is done in the S32 Configuration Tool to allow full flexibility on the settings you need. So basically, to check if a feature is supported by the NXP's MBDT S32K3xx, you can check the source code used by the peripheral (in the S32K3 RTD) and its available settings in the S32 Configuration Tool.
In the toolbox, you can find the implementation for the FlexCAN peripheral here: {toolboxRoot}/src/S32K3_RTD/SW32K3_S32M27x_RTD_R21-11_6.0.0/eclipse/plugins/Can_43_FLEXCAN_TS_T40D34M60I0R0/
Note! The name of the S32K3 RTD might differ, depending on which version of the MBDT S32K3 do you use.
The answers to your questions are based on my experience and they might not be totally accurate.
1 & 2 & 5: The toolbox does not handle any arbitration, but I am not sure what options are available in the SDK for this matter. In your example, you create another CanHardwareObject and use it to send the second message, but this approach might be difficult to manage. The second solution might be to increate the Can Hw Object Count to allow more messages in the buffer.
3: The MBDT for S32K3 does not handle any message prioritization. As far as I know, that's the job of the FlexCAN controller to retry to send the message until the ACK is received, while blocking the message the buffer.
4. One way to detect if a message is sent or not is to use interrupt CanIf_TxConfirmation in the Hardware Interrupt Callback to mark that a message is sent. If the interrupt is not triggered for the specified PDU, it means that the message is not sent. Moreover, there is another interrupt (CAN_ControllerBusOff) available that triggers when the conditions for CAN Bus Off are met. In the S32 Configuration Tool, there is an option to automatically recover from Bus Off.
If you have any questions, do not hesitate to reply.
Best regards,
Sorin Bancila
Hello,
How many messages do you think you need to transmit at one time?
I've tested on a S32K358 HVBMS reference design the following scenario:
The results:
As expected, the first messages sent are with low priority, as the message buffer is not completely populated. Around the 6th message, the buffer is populated and we can see that the messages with higher priority are sent first.
Since you want to use a single transceiver, it is not really possible to simultaneously send all the messages at the same time.
Best regards,
Sorin Bancila
Hello,
The 32 Can Hw Object Count is not the limit. You can increase the limit even further, depending on what MCU you have. You can modify the number of Can Hw Object Count and if you put a number too large, the S32CT is going to throw an error.
Best regards,
Sorin Bancila