-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fixbug: Fix the bug emmc bug #11139
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
base: master
Are you sure you want to change the base?
Fixbug: Fix the bug emmc bug #11139
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: Maihuanyi Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-01-19 15:25 CST)
📝 Review Instructions
|
|
For more details, please refer to: https://club.rt-thread.org/ask/question/26ae04a2e1a47f0d.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an eMMC bug where CMD6 (SWITCH command) is sent to modify the EXT_CSD register, but the card status is not subsequently polled to verify the operation completed successfully. This can cause failures when switching to high-speed DDR mode. The fix adds two new helper functions (mmc_send_status and mmc_poll_for_busy) that implement CMD13 status polling with timeout handling, and integrates this polling into the mmc_switch function.
Changes:
- Added
mmc_send_status()function to send CMD13 and retrieve card status - Added
mmc_poll_for_busy()function to poll card status until ready or timeout - Modified
mmc_switch()to callmmc_poll_for_busy()after sending CMD6
…the card is not queried, which can cause failure in switching to the high-speed mode in DDR mode.
…the card is not queried, which can cause failure in switching to the high-speed mode in DDR mode.
…the card is not queried, which can cause failure in switching to the high-speed mode in DDR mode.
3ed106b to
c433ad4
Compare
|
LGTM |
拉取/合并请求描述:(PR description)
Fix the bug where the cmd6 command is sent but the status of the card is not queried, which can cause failure in switching to the high-speed mode in DDR mode.
为什么提交这份PR (why to submit this PR)
Solve the issue of normal code execution in the eMMC DDR mode.
你的解决方案是什么 (what is your solution)
Add command 13 polling in mmc_switch.
当前拉取/合并请求的状态 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