-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/samd5x: improve can-initialization #21173
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a device to test this, but looks sensible from a quick glance. Do you have a pointer to the datasheet?
|
||
/* setup */ | ||
pchctrl = GCLK_PCHCTRL_GEN(dev->conf->gclk_src); | ||
GCLK->PCHCTRL[pchid].reg = pchctrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why no busy wait loop here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point the register is changeable (since the channel is deactivated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @mguetschow suggested to add a comment here to explain why not waiting here, in contrast to the other writes.
93a057b
to
98ce32d
Compare
I tested this with my SAME54-XPRO. In master: TX works, RX does not, unless But having the clock init better matching the process in the datasheet does have merit. Please squash! |
98ce32d
to
1fa6e09
Compare
Contribution description
This makes the can initialization for the samd5x more stable
Testing procedure
find a Board that uses this cpu but has sight problems of getting the can bus up reliably
find its more reliable with this Patch
Issues/PRs references
SAM D5x/E5x Family datasheet page 144 (DS60001507M) 14.6.3.3