Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect timing calculation in can_mcux_flexcan #31014

Closed
GrixaYrev opened this issue Dec 27, 2020 · 0 comments · Fixed by #31015
Closed

Incorrect timing calculation in can_mcux_flexcan #31014

GrixaYrev opened this issue Dec 27, 2020 · 0 comments · Fixed by #31015
Assignees
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@GrixaYrev
Copy link
Contributor

GrixaYrev commented Dec 27, 2020

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:

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.

@GrixaYrev GrixaYrev added the bug The issue is a bug, or the PR is fixing a bug label Dec 27, 2020
@alexanderwachter alexanderwachter self-assigned this Dec 27, 2020
@nashif nashif added the priority: medium Medium impact/importance bug label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants