Skip to content

cpu/sam3: fix PMC enable/disable peripheral clock access #21168

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

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

dylad
Copy link
Member

@dylad dylad commented Jan 27, 2025

Contribution description

This PR fixes the access of PMC enable/disable peripheral clock.
PMC_PCERx registers are labelled write-only in SAM3/SAM4S datasheet. Thus writing 0 has no effect. This means we cannot use PCERx to disable a peripheral clock. Instead one must use PCEDx register to properly disable a peripheral clock.

As both registers (enable/disable) are write-only, this PR also drops the read-modify-write for a single write.

Testing procedure

CI should be enough I guess.

Issues/PRs references

None

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jan 27, 2025
@dylad dylad added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 27, 2025
@riot-ci
Copy link

riot-ci commented Jan 27, 2025

Murdock results

✔️ PASSED

b4d0619 cpu/sam3: fix PMC enable/disable peripheral clock access

Success Failures Total Runtime
10271 0 10271 09m:59s

Artifacts

@maribu maribu requested review from benpicco and maribu January 28, 2025 07:25
Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Double-checked with the datasheet, looks good. Thanks!

@mguetschow mguetschow enabled auto-merge January 28, 2025 09:13
@mguetschow mguetschow added this pull request to the merge queue Jan 28, 2025
Merged via the queue into RIOT-OS:master with commit e8be6ee Jan 28, 2025
28 checks passed
@dylad
Copy link
Member Author

dylad commented Jan 28, 2025

Thanks !

@dylad dylad deleted the pr/cpu/sam3/fix_pmc_access branch January 28, 2025 11:00
@mguetschow mguetschow added this to the Release 2025.04 milestone Apr 8, 2025
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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

3 participants