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

drivers: can: stm32: timing_max parameters are not correct #61451

Closed
str4t0m opened this issue Aug 13, 2023 · 0 comments · Fixed by #61449
Closed

drivers: can: stm32: timing_max parameters are not correct #61451

str4t0m opened this issue Aug 13, 2023 · 0 comments · Fixed by #61449
Assignees
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug

Comments

@str4t0m
Copy link
Collaborator

str4t0m commented Aug 13, 2023

Describe the bug
The timing_max parameters defined in the stm32 bxCAN driver don't match the register description in the reference manuals.

  • sjw does have only 2 bits representing 1 to 4 tq.
  • phase_seg1 and phase_seg2 max is one tq higher.

Expected behavior
I have checked the following reference manuals and all have only 2 SJW bits and can use all possible TS1 and TS2 values in the defined bit range.

  • RM0090: STM32F405, F415, F407, F417, F427, F437 AND F429
  • RM0008: STM32F101, F102, F103, F105, F107 advanced arm-based mcus
  • RM0351, RM0394: all STM32L4
  • RM0091: all STM32F0 with CAN support

Impact
Users might be misled to configure unsupported timing parameters.

Environment (please complete the following information):

  • OS: Linux
  • Toolchain Zephyr SDK
  • Commit SHA: d11c0a1

Additional context
Issue discovered through code inspection.

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 platform: STM32 ST Micro STM32 priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants