Skip to content

Conversation

@william-tang914
Copy link
Contributor

Move the FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG conditional logic from the general timing configuration to only apply within the CAN FD specific sections.

This ensures that for classic CAN mode, prop_seg is always decremented by 1 regardless of the enhanced bit timing register feature.

The previous implementation incorrectly applied the enhanced bit timing logic to classic CAN mode, which could cause timing misconfiguration on devices with enhanced bit timing register support when operating in classic CAN mode.

Fixes #99746

Move the FSL_FEATURE_FLEXCAN_HAS_ENHANCED_BIT_TIMING_REG conditional
logic from the general timing configuration to only apply within the
CAN FD specific sections.

This ensures that for classic CAN mode, prop_seg is always decremented
by 1 regardless of the enhanced bit timing register feature.

The previous implementation incorrectly applied the enhanced bit timing
logic to classic CAN mode, which could cause timing misconfiguration
on devices with enhanced bit timing register support when operating in
classic CAN mode.

Fixes zephyrproject-rtos#99746

Signed-off-by: William Tang <william.tang@nxp.com>
@sonarqubecloud
Copy link

@hakehuang
Copy link
Contributor

board test pass on v4.3.0-721-gc4b3b580816

}
#endif /* CONFIG_CAN_MCUX_FLEXCAN_FD */

FLEXCAN_SetTimingConfig(base, &timing);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved? Looks like the data phase timing is now applied to the arbitration phase as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: drivers: can: frdm_mcxn947: test 6/10 pytest scenario(s) failed

6 participants