Repository navigation
stm32: Fix printing value of pyb.CAN auto_restart on FDCAN hardware. - #18951
Merged
dpgeorge merged 1 commit intoMar 19, 2026
Merged
Conversation
Contributor
Author
|
Very glad this doesn't change the print output, so don't have to revisit the |
9 tasks done
projectgus
commented
Mar 19, 2026
| @@ -144,7 +144,7 @@ static void pyb_can_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki | |||
| self->can_id, | |||
| mode, | |||
| #if MICROPY_HW_ENABLE_FDCAN | |||
| (self->can.Instance->CCCR & FDCAN_CCCR_DAR) ? MP_QSTR_True : MP_QSTR_False | |||
| MP_QSTR_False // auto_restart not supported on FDCAN hardware | |||
| #else | |||
| (self->can.Instance->MCR & CAN_MCR_ABOM) ? MP_QSTR_True : MP_QSTR_False | |||
Contributor
Author
There was a problem hiding this comment.
Uncrustify insists on this indent here, for whatever reason. 🤷
|
Code size report: |
Member
Yes, I saw this as well in my testing. |
The DAR register field is for auto-retransmit, FDCAN doesn't support automatic restart to clear Bus Off. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
dpgeorge
force-pushed
the
bugfix/pyb_can_print_auto_restart
branch
from
March 19, 2026 14:18
716e3f0 to
c802a13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As pointed out in #18572 (comment). The DAR register field is for disabling auto-retransmit, FDCAN hardware doesn't support automatic restart to clear Bus Off.
This work was funded through GitHub Sponsors.
Testing
Manually built a NUCLEO_G474RE board and ran the
pyb_can.pyunit test.Generative AI
I did not use generative AI tools when creating this PR.