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/stm32/periph: add low-level SDMMC peripheral driver #19540

Merged
merged 5 commits into from
Dec 24, 2023

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented May 2, 2023

Contribution description

This PR implements the low-level SDIO/SDMMC peripheral driver for STM32 according to the definition in #19539. STM32 F2, F4 and F7 are supported. The DMA peripheral driver had to be extended for SDIO/SDMMC.

The PR also enables the SD Card Slot for the stm32f746g-disco and stm32l496g-disco.

Testing procedure

BOARD=stm32f746g-disco make -C tests/drivers/sdmmc
BOARD=stm32f746g-disco make -C tests/sys/vfs_default

Issues/PRs references

Depends on PR #19539
Depends on PR #19899
Depends on PR #20104

@github-actions github-actions bot added Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Platform: ARM Platform: This PR/issue effects ARM-based platforms labels May 2, 2023
@gschorcht gschorcht added the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label May 2, 2023
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch 2 times, most recently from 8a6ef57 to f175caa Compare May 3, 2023 14:03
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from f175caa to e29320e Compare May 10, 2023 12:11
@github-actions github-actions bot added the Area: Kconfig Area: Kconfig integration label May 10, 2023
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch 2 times, most recently from 7fa75af to 65cc37a Compare June 24, 2023 15:48
@gschorcht gschorcht added State: waiting for other PR State: The PR requires another PR to be merged first Type: new feature The issue requests / The PR implemements a new feature for RIOT and removed State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Jun 24, 2023
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from 65cc37a to 715120f Compare June 25, 2023 10:30
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from 715120f to c7b8362 Compare July 2, 2023 16:11
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Jul 2, 2023
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from c7b8362 to 5c8db7b Compare July 3, 2023 04:30
@github-actions github-actions bot removed the Area: tests Area: tests and testing framework label Jul 3, 2023
@benpicco benpicco enabled auto-merge December 21, 2023 16:19
@benpicco benpicco added this pull request to the merge queue Dec 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 21, 2023
@gschorcht
Copy link
Contributor Author

🤔 due to the last change the compilation fails now for applications that don't use periph_sdmmc for boards that have a sdmmc_config 😟 I'm wondering whether it is better also to embed these sdmmc_configs in preprocessor conditional using MODULE_PERIPH_SDMMC or to check for the existence of SDMMC_POWER_CTRL to embed the definition of the sdmmc_config_t in preprocessor conditionals to avoid compilation problems for MCUs that don't have a SDMMC peripheral.

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Dec 21, 2023
@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from 53cd37e to af142f6 Compare December 21, 2023 16:59
@github-actions github-actions bot removed the Area: tests Area: tests and testing framework label Dec 21, 2023
@gschorcht
Copy link
Contributor Author

@benpicco The alternative to af142f6 would be to embed the declaration static const sdmmc_conf_t sdmmc_config[] in the board definition in a preprocessor condition using the MODULE_PERIPH_SDMMC definition.

@benpicco
Copy link
Contributor

af142f6 looks fine, let's squash and see what CI thinks of it

@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from af142f6 to 2c2e70f Compare December 21, 2023 17:38
@gschorcht gschorcht added this pull request to the merge queue Dec 22, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 22, 2023
@gschorcht
Copy link
Contributor Author

gschorcht commented Dec 22, 2023

@benpicco I had to add HAS_PERIPH_SDMMC also to the Kconfig of the stm32f7508-dk board (335f4f8) because it is using the stm32f746g-disco board configuration but has its own Kconfig file 🙈 I didn't realize that before. Let's see whether it works now.

@benpicco benpicco added this pull request to the merge queue Dec 22, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 22, 2023
@benpicco
Copy link
Contributor

I think you might as well remove the Kconfig altogether

@gschorcht
Copy link
Contributor Author

I think you might as well remove the Kconfig altogether

@benpicco I just forgot also to add select HAVE_MTD_SDMMC_DEFAULT (a215d0d). It should work now.

@benpicco
Copy link
Contributor

Please squash!

@gschorcht gschorcht force-pushed the cpu/stm32/periph/sdmmc branch from a215d0d to b3f3e16 Compare December 23, 2023 16:19
@benpicco benpicco added this pull request to the merge queue Dec 23, 2023
Merged via the queue into RIOT-OS:master with commit 7c2f091 Dec 24, 2023
25 checks passed
@gschorcht
Copy link
Contributor Author

Thanks 😄

@gschorcht gschorcht deleted the cpu/stm32/periph/sdmmc branch December 24, 2023 08:41
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.01 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration 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: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants