【求助】请教SDIO TF卡初始化异常问题

nkeverstar 2019-09-04 08:53:17
两种tf卡,A和B,都是金士顿16G class 10的。

A卡初始化为低速卡
=========================================
EMMC/MMC/SD controller initialization.
CMD41 send:0x40300000
CMD41 response:0xc0ff8000
mmc scr:0x858082
Device is not exit !
MMC/SD Card:
MID: 0x9f
Read Block: 512 Bytes
Write Block: 512 Bytes
Chip Size: 14832M Bytes (High Capacity)
Name: "SD16G"
Chip Type: SD
Version: 1.0
Speed: 25000000Hz
Bus Width: 1bit
Boot Addr: 0 Bytes
In: serial
Out: serial
Err: serial


A卡初始化为低速卡
=========================================
EMMC/MMC/SD controller initialization.
CMD41 send:0x40300000
CMD41 response:0xc0ff8000
mmc scr:0x2058083
Device is not exit !
MMC/SD Card:
MID: 0x9f
Read Block: 512 Bytes
Write Block: 512 Bytes
Chip Size: 14760M Bytes (High Capacity)
Name: "SD16G"
Chip Type: SD
Version: 2.0
Speed: 50000000Hz
Bus Width: 4bit
Boot Addr: 0 Bytes
In: serial
Out: serial
Err: serial

日志打印,A卡初始化异常,是因为sd_send_op_cond (CMD55 + 41) 导致。SD卡不是专业,求助高手。
...全文
586 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
nkeverstar 2019-09-23
  • 打赏
  • 举报
回复
最新进展:
1. 此规格卡为1.8v UHS高速卡,我手上的Hi3518Ev200模块IO电压支持1.8v;
2. 参照SD卡协议: SD Specifications Part A2 SD Host Controller Simplified Specification Version 1.00 和 SD Specifications Part 1 Physical Layer Simplified Specification Version 6.00:
- 在CMD41时置S18R 位,tf卡S18A位为1,则在CMD41后,进行CMD11将工作电压从3.3v切换到1.8v。
- CMD2 等继续配置。

遗留待确认问题:
此批次tf卡,在S18R/A 未操作,未切换电压时,为什么寄存器SCR的SD_SPEC位从0x02 变成了 0x00(同样操作另一批次卡没有改变)?
需要tf卡方面的专业人士解答。

PS:uboot修改支持1.8v 高速(>10M/s)其实不复杂,难就在于解读协议。仅需要修改mmc.h, mmc.c 两个文件几处即可。
SeanOY 2019-09-16
  • 打赏
  • 举报
回复
http://www.openedv.com/posts/list/17179.htm 你看一下
nkeverstar 2019-09-16
  • 打赏
  • 举报
回复
引用 2 楼 SeanOY 的回复:
异常是怎么个异常法呢

2. 该tf卡 CMD41 设置参数 0x40300000后,后面通过CMD51 读取的SCR 值为 0x858082;

然而:
2. 该tf卡 CMD41 设置参数 0x41300000后,后面通过CMD51 读取的SCR 值为 0x2358043;
nkeverstar 2019-09-16
  • 打赏
  • 举报
回复
2. 该tf卡 CMD41 设置参数 0x40300000后,后面通过CMD51 读取的SCR 值为 0x858082;


然而:
2. 该tf卡 CMD41 设置参数 0x41300000后,后面通过CMD51 读取的SCR 值为 0x2358043;
nkeverstar 2019-09-11
  • 打赏
  • 举报
回复
1. 该tf卡 支持 CMD8,返回version 2.0;
2. 该tf卡 CMD41 设置参数 0x40300000后,后面通过CMD51 读取的SCR 值为 0x858082;
3. 该卡依然能够支持CMD6 等指令;

继续调试,发现: CMD9 读取的OSC寄存器值如下:CMD9 response[0]:0x400e0032, response[1]:0x5b590000, response[2]:0x73df7f80, response[3]:0xa4000c7,

也就是说,该卡的SD_SPEC = 0, CCC & bit 10 = 1。也就是说该卡支持CMD6&CMD8。所以我直接对 CMD8 和 SD_SPEC/CCC 进判断,如果CMD6和CMD8 都支持,直接判定为2.0。 有SD 方面的专家没,请帮忙看下是否可行。

根据SD specifications:

• Version 1.10 Card Requirements (SD_SPEC is set to 1)
(1) The card shall support CMD6
(2) The card does not support CMD8
(3) User area capacity shall be up to 2GB

• Version 1.10 Card Requirements (SD_SPEC is set to 1)
(1) The card shall support CMD6
(2) The card does not support CMD8
(3) User area capacity shall be up to 2GB

• Version 2.00 Card Requirements (SD_SPEC is set to 2)
(1) The card shall support CMD6
(2) The card shall support CMD8
(3) The card shall support CMD42
(4) In case of SDHC, the card shall support Speed Class
(5) User area capacity shall be up to 32GB.

Therefore, cards that are
compatible with earlier versions of the spec do not support it. The host should check the "SD_SPEC"
field in the SCR register to identify what version of the spec the card complies with before using CMD6.
It is also possible to check support of CMD6 by bit10 of CCC in CSD. It is mandatory for an SD memory
card of Version 1.10 and higher to support CMD6.
SeanOY 2019-09-11
  • 打赏
  • 举报
回复
异常是怎么个异常法呢

21,615

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 驱动开发/核心开发
社区管理员
  • 驱动开发/核心开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧