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: fix bus-speed #31161

Merged
merged 1 commit into from
Jan 10, 2021

Conversation

jdascenzio
Copy link
Contributor

@jdascenzio jdascenzio commented Jan 7, 2021

Set the prescaler in register BTR according to the configured bitrate in DTS.
This bug appeared in commit 8b6c1bd

Signed-off-by: Julien D'Ascenzio [email protected]

@martinjaeger martinjaeger added the bug The issue is a bug, or the PR is fixing a bug label Jan 8, 2021
Copy link
Member

@martinjaeger martinjaeger left a comment

Choose a reason for hiding this comment

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

Thanks for that fix, which provides a partial solution for #31150 aswell. Just got a small change request.

drivers/can/can_stm32.c Outdated Show resolved Hide resolved
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Approved from testing point of view. tests/subsys/canbus/isotp/conformance is now passed (and the MPU FAULT went away, even if not related)

Copy link
Member

@alexanderwachter alexanderwachter left a comment

Choose a reason for hiding this comment

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

The rest looks good!
Hanks for this fix. I wonder why I didn't catch the bug in my tests 🤔

drivers/can/can_stm32.c Outdated Show resolved Hide resolved
Set the prescaler in register BTR according to the configured bitrate in DTS.
This bug appeared in commit 8b6c1bd

Signed-off-by: Julien D'Ascenzio <[email protected]>
@erwango erwango requested a review from galak January 8, 2021 13:41
@erwango
Copy link
Member

erwango commented Jan 8, 2021

@martinjaeger @alexanderwachter can we state: fixes #31150 ?
Or do you expect another fix ?

@martinjaeger
Copy link
Member

@martinjaeger @alexanderwachter can we state: fixes #31150 ?
Or do you expect another fix ?

For me it does not completely fix the isotp/conformance test, so there must be another bug. I still get a hard fault on nucleo_l452re:

*** Booting Zephyr OS build zephyr-v2.4.0-2839-g4b7eb0500dbf  ***
Running test suite isotp_conformance
===================================================================
START - test_send_sf
E: ***** HARD FAULT *****
E: r0/a1:  0x20001068  r1/a2:  0x2000109c  r2/a3:  0x00000008
E: r3/a4:  0x000000f9 r12/ip:  0x00000000 r14/lr:  0x08000be1
E:  xpsr:  0x21000000
E: Faulting instruction address (r15/pc): 0x08000b10
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x20000498 (ztest_thread)
E: Halting system

@henrikbrixandersen henrikbrixandersen removed their request for review January 9, 2021 22:59
@nashif nashif merged commit f1963dd into zephyrproject-rtos:master Jan 10, 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 platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants