bsp: stm32f407-micu: add SDIO support#11081
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: Liang1795 hamburger-os wdfk-prog Changed Files (Click to expand)
🏷️ Tag: bsp_stm32f407-micuReviewers: Dailingxiang1 Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-12-24 14:17 CST)
📝 Review Instructions
|
|
这个是用ioc生成的吗?可以更新一下ioc |
|
There was a problem hiding this comment.
Pull request overview
This PR adds SDIO (Secure Digital Input/Output) support to the STM32F407-MICU BSP, enabling SD card functionality for the board. The changes configure the SDIO peripheral with appropriate GPIO pins (PC8-PC12 for data/clock, PD2 for command) and add Kconfig options for enabling SDIO with configurable maximum frequency.
Key changes:
- Added Kconfig configuration for SDIO with configurable maximum frequency (default 1MHz, range 0-24MHz)
- Implemented HAL MSP initialization and deinitialization functions for SDIO peripheral
- Enabled HAL SD module support in HAL configuration
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
bsp/stm32/stm32f407-micu/board/Kconfig |
Added BSP_USING_SDIO configuration option with SDIO_MAX_FREQ parameter for configurable SD card clock frequency |
bsp/stm32/stm32f407-micu/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c |
Added HAL_SD_MspInit and HAL_SD_MspDeInit functions to configure SDIO GPIO pins (PC8-12, PD2) and peripheral clocks |
bsp/stm32/stm32f407-micu/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h |
Enabled HAL_SD_MODULE_ENABLED macro to include SD card HAL driver support |
bsp/stm32/stm32f407-micu/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
Outdated
Show resolved
Hide resolved
bsp/stm32/stm32f407-micu/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
Outdated
Show resolved
Hide resolved
| config BSP_USING_SDIO | ||
| bool "Enable SDIO" | ||
| select RT_USING_SDIO | ||
| default n |
There was a problem hiding this comment.
config BSP_USING_SDIO
bool "Enable SDIO"
select RT_USING_SDIO
default n
if BSP_USING_SDIO
config SDIO_MAX_FREQ
int "sdio max freq"
range 0 24000000
depends on BSP_USING_SDIO
default 1000000
endif
Update bsp/stm32/stm32f407-micu/board/Kconfig Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update bsp/stm32/stm32f407-micu/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update bsp/stm32/stm32f407-micu/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update bsp/stm32/stm32f407-micu/board/Kconfig
848a9a1 to
9e7f6d3
Compare
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
添加SDIO支持
你的解决方案是什么 (what is your solution)
添加SDIO支持
请提供验证的bsp和config (provide the config and bsp)
BSP: bsp/stm32/stm32f407-micu
.config:
使能DFS里面的elm文件系统格式
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up