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/sam0_common/periph/sdhc: busy waiting and clock fixes #19815

Merged

Conversation

benpicco
Copy link
Contributor

Contribution description

This PR collects fixes to the sam0 SDHC driver (that soon will be replaced by periph_sdmmc):

  • replace the interrupt based wait for events with a busy wait solution. This prevents mysterious hard faults that keep occurring with the interrupt based solution.
  • make sure the SD card clock does not exceed the specification
  • disable the SD card clock when no transfer is active to save power

Testing procedure

Issues/PRs references

The only peripheral that currently uses the FDPLL1 is SDHC. However, the SDHC IP can only be clocked at up to 150 MHz. Therefore, 100 MHz is currently used as the frequency of the FDPLL1. If another peripheral device requires 200 MHz in the future, this must be realized via different clock generators.
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jul 11, 2023
@benpicco benpicco added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) and removed Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jul 11, 2023
@benpicco benpicco force-pushed the cpu/sam0_common/periph/sdhc_busy_waiting branch from fc28030 to 84ceea3 Compare July 11, 2023 10:46
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jul 11, 2023
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 23, 2023
Copy link
Contributor

@gschorcht gschorcht left a comment

Choose a reason for hiding this comment

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

Looks good.

@riot-ci
Copy link

riot-ci commented Aug 23, 2023

Murdock results

✔️ PASSED

84ceea3 cpu/sam0_common/periph/sdhc: always use 25 MHz

Success Failures Total Runtime
7939 0 7939 14m:09s

Artifacts

@benpicco
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Aug 23, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 2a4496b into RIOT-OS:master Aug 23, 2023
25 checks passed
@benpicco benpicco deleted the cpu/sam0_common/periph/sdhc_busy_waiting branch August 23, 2023 20:36
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.10 milestone Nov 17, 2023
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.

4 participants