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

cpu/samd5x: disable ONDEMAND on clock with periph_can #21158

Closed
wants to merge 1 commit into from

Conversation

maribu
Copy link
Member

@maribu maribu commented Jan 23, 2025

Contribution description

From SAME54 errata 2.4.9:

On Demand

The CAN is not compatible with on-demand clock requests.

Workaround

Clear the ONDEMAND bit to zero for the oscillator source that
provides the GCLK to the CAN.

Since the same CAN peripheral is used across all supported SAMD5x MCUs, the same should be true for the other MCUs.

Testing procedure

This should actually cause issue with the CAN driver, but it works fine for most boards.

For the board where CAN does not behave correctly, it does not fix the issue.

Issues/PRs references

None

From [SAME54 errata][1] 2.4.9:

> ## On Demand
> The CAN is not compatible with on-demand clock requests.
>
> ## Workaround
> Clear the ONDEMAND bit to zero for the oscillator source that
> provides the GCLK to the CAN.

Since the same CAN peripheral is used across all supported SAMD5x MCUs,
the same should be true for the other MCUs.

[1]: https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/Errata/SAM-D5x-E5x-Family-Silicon-Errata-and-Data-Sheet-Clarification-DS80000748.pdf
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jan 23, 2025
@benpicco benpicco added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Jan 23, 2025
@dylad
Copy link
Member

dylad commented Feb 11, 2025

@maribu Any reasons to keep as draft ?

@maribu
Copy link
Member Author

maribu commented Feb 11, 2025

No, we can drop this.

In fact, the CAN not only can request the GCLK on demand, but also needs the APB clock for RAM access to actually be able to receive. So we need to pm_block() idle anyway, and ondemand doesn't matter anyway.

The actual fix got upstream already.

@maribu maribu closed this Feb 11, 2025
@maribu maribu deleted the cpu/samd5x/can-no-ondemand branch February 11, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants