Incorrect timing calculation in can_mcux_flexcan #31014
Labels
area: CAN
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Describe the bug
Fields
propSeg
,phaseSeg1
andphaseSeg2
are given to FLEXCAN HAL without conversion (i.e. like register value), but this fields are used in timing calculation like interval value. Interval value is equal register value increased by one.Incorrect bus speed and large number of errors are in result.
To Reproduce
Speed of FlexCAN 250k and greater (When speed is 125k, deviation is not critical).
Expected behavior
Real bus speed is equal expected bus speed.
Impact
Showstopper
Environment:
Variant of solution
Fields
propSeg
,phaseSeg1
,phaseSeg2
,rJumpwidth
andpreDivider
should decreased by one before giveing to FLEXCAN HAL in lines 140..144 and 171..174 of filedrivers\can\can_mcux_flexcan.c
. Also temporary struct is needed in functionmcux_flexcan_set_timing()
, becausedata->timing
should have interval value rather than register value.The text was updated successfully, but these errors were encountered: