Dear NXP Team,
I have some queries regarding the CAN module of the S32K324 microcontroller:
Is there any existing API or recommended method provided by NXP to calculate the CAN bus load per second (bus utilization)?
What are the best practices or available mechanisms in the S32K3xx platform to detect and control CAN bus.
I would appreciate your guidance or pointers to relevant APIs, example code, or documentation that can assist in implementing bus load monitoring and bus flooding protection.
Thank you for your support.
Best regards,
P.Ranjith kumar
Solved! Go to Solution.
Hi,
1) the FlexCAN does not have a direct support for bus utilization and there is no API for that as well.
2) a generic approach could be
- monitor/receive all messages on the bus
- estimate message size in bits, accumulate number of bits received. This can differ little bit from actual one due to stuff bits included. Also consider CAN FD message can switch bitrate for data phase.
- at desired time interval (1 sec) or measurement duration calculate a time of a message using different bitrates for both phases. Then this message time duration is divided by time of measurement, which should give bus load.
BR, Petr
Hi,
1) the FlexCAN does not have a direct support for bus utilization and there is no API for that as well.
2) a generic approach could be
- monitor/receive all messages on the bus
- estimate message size in bits, accumulate number of bits received. This can differ little bit from actual one due to stuff bits included. Also consider CAN FD message can switch bitrate for data phase.
- at desired time interval (1 sec) or measurement duration calculate a time of a message using different bitrates for both phases. Then this message time duration is divided by time of measurement, which should give bus load.
BR, Petr