-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Describe the bug
Fields propSeg, phaseSeg1 and phaseSeg2 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:
- Commit: 4ca7942
- i.MX RT1052
Variant of solution
Fields propSeg, phaseSeg1, phaseSeg2, rJumpwidth and preDivider should decreased by one before giveing to FLEXCAN HAL in lines 140..144 and 171..174 of file drivers\can\can_mcux_flexcan.c. Also temporary struct is needed in function mcux_flexcan_set_timing(), because data->timing should have interval value rather than register value.