SD卡初始化;acmd41 失败; [英] SD card initialisation; acmd41 fails;
问题描述
我正在尝试初始化 SD 卡,但从未准备好卡.
I'm trying to init sd card and never get card ready.
详情:
有带芯片的开发板,带有 SD Host 控制器和 micro SDHC UHS-1 卡.
There are dev board with a chip with a SD Host controller and micro SDHC UHS-1 card.
我正在遵循的初始化序列:
Init sequence I'm following:
- cmd0:arg
0x00
.没关系 cmd8:arg
0x1AA
.好的,返回 0x1aa.
- cmd0: arg
0x00
. That is fine cmd8: arg
0x1AA
. Fine, 0x1aa is returned back.
acmd41:
-- 第一个 cmd55: arg 0x00
.很好,响应 0x120
表示设置了app_cmd"标志.
-- 第二个 cmd41: arg 0x5100'0000
(HCS: 1; XPC: 1; S18R: 1 - SDHC/SDXC 支持; 最高性能; 分别切换到 1.8V)响应为 0xff8000
.所以这似乎是一个有效的 OCR,支持整个电压范围.
acmd41:
-- first cmd55: arg 0x00
. Fine, response 0x120
indicates that 'app_cmd' flag is set.
-- second cmd41: arg 0x5100'0000
(HCS: 1; XPC: 1; S18R: 1 - SDHC/SDXC supported; Maximum performance; Switch to 1.8V respectively)
Response is 0xff8000
. So that seems to be a valid OCR, supporting a whole voltages range.
一旦知道卡支持的 OCR,我会再次发送 ACMD41 并设置 OCR:
-- cmd55: arg 0x00
.有效的 0x120
响应.
-- cmd41: arg 0x51ff'80000
.
在这种情况下,即使 SD 主机控制器没有指示任何错误,如超时或错误的 CRC,我总是从一张卡中获得 0xffff'ffff
发送该值.
Once OCR supported by a card is known I send ACMD41 again with a set OCR:
-- cmd55: arg 0x00
. valid 0x120
response.
-- cmd41: arg 0x51ff'80000
.
In this case I always get 0xffff'ffff
from a card which is not a proper respond by any means even though SD Host controller do not indicate any errors like timeout or wrong CRC, so that seems that card indeed sends that value.
重复上述acmd41(cmd55 + cmd41)继续返回相同的响应,cmd55没问题,cmd41为0xffffffff
Repeating described above acmd41 (cmd55 + cmd41) continue to return the same response, cmd55 is fine, cmd41 is 0xffffffff
知道出了什么问题/我遗漏了吗?
Any ideas what is going wrong/I'm missing?
谢谢.
推荐答案
很快,卡片初始化序列就可以了.那是硬件问题.
Shortly, card init sequence is fine. That's a hardware issue.
卡的电源被拧紧,因此卡没有足够的电量来正常工作,但不知何故有足够的电量来发送响应.
Power supplying to a card was screwed, so card didn't have enough power for a proper work but somehow got enough to send a responds.
为了让我尝试的几张卡片变得更有趣:
To make things even more interesting out of a few cards I tried:
- 一张卡根本无法使用
- 初始化失败(如上所述)
- 当试图写入数据时,一个人做了所有事情,但无限期地保持在编程"状态.
谢谢大家:)
这篇关于SD卡初始化;acmd41 失败;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!