查看: 313|回复: 5

[求助] RT1052 使用SDK SD卡驱动,CMD引脚无输出

[复制链接]

该用户从未签到

1

主题

6

帖子

0

注册会员

Rank: 2

积分
51
最后登录
2024-1-4
发表于 2023-12-15 16:02:49 | 显示全部楼层 |阅读模式
你好,我想通过正点原子RT1052开发板操作SD卡, 按照移植“SDK_2_14”  sdcard_freertos 例程,上电后只能抓到CLK波形,CMD引脚无数据。软件错误log提示:
(Middleware/sdmmc/sd/fsl_sd.c 1209) Error: send CMD8 failed with host error 1, response 0
(Middleware/sdmmc/sd/fsl_sd.c 1184)Error: send ACMD41 timeout

(APP/sdcard_freertos.c 134)SD card init failed.

异常波形:

1、硬件功能正常,根据原子提供基于”SDK_2_4 ”SD卡例程,可以正常操作SD卡,有正常CMD0、CMD8波形。


2、官方SDK针对SD卡有CD检测、电源控制引脚,在我硬件上没有。
3、部分程序文件,见附件。





bsp_sdmmc.zip

6.81 KB, 下载次数: 0, 下载积分: 威望 1

回复

使用道具 举报

该用户从未签到

1

主题

6

帖子

0

注册会员

Rank: 2

积分
51
最后登录
2024-1-4
 楼主| 发表于 2023-12-16 11:07:37 | 显示全部楼层
已有波形,现在报错如下:
Error: send CMD12 failed with host error 1, reponse 0

Error: send CMD12 failed with host error 1, reponse 0

Error: send CMD12 failed with host error 1, reponse 0

Error: send CMD12 failed with host error 1, reponse 0

Error: send ACMD13 failed with host error 1844, response 920

SD card init failed.
不知道该如何分析
回复 支持 反对

使用道具 举报

该用户从未签到

1

主题

6

帖子

0

注册会员

Rank: 2

积分
51
最后登录
2024-1-4
 楼主| 发表于 2023-12-16 11:10:41 | 显示全部楼层
ZY_27b383 发表于 2023-12-16 11:07
已有波形,现在报错如下:
Error: send CMD12 failed with host error 1, reponse 0

抓出来的波形通讯协议如下:

Id,Time[ns],SD card (SD mode): Commands
0,10055800.00000000000000000000,CMD0 (GO_IDLE_STATE): Reset all SD cards
1,10291100.00000000000000000000,CMD8 (SEND_IF_COND): Send interface condition to card
2,10435900.00000000000000000000,Response: R7
3,10648000.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
4,10787600.00000000000000000000,Response: R1
5,10994500.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
6,11131600.00000000000000000000,Response: R3
7,20973600.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
8,21115800.00000000000000000000,Response: R1
9,21320100.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
10,21457100.00000000000000000000,Response: R3
11,30973300.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
12,31115500.00000000000000000000,Response: R1
13,31319800.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
14,31456900.00000000000000000000,Response: R3
15,40973100.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
16,41115300.00000000000000000000,Response: R1
17,41319600.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
18,41456600.00000000000000000000,Response: R3
19,50972800.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
20,51115000.00000000000000000000,Response: R1
21,51319300.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
22,51456400.00000000000000000000,Response: R3
23,60972500.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
24,61114800.00000000000000000000,Response: R1
25,61319100.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
26,61456100.00000000000000000000,Response: R3
27,70972300.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
28,71114500.00000000000000000000,Response: R1
29,71318800.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
30,71455900.00000000000000000000,Response: R3
31,80974600.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
32,81116900.00000000000000000000,Response: R1
33,81321100.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
34,81458200.00000000000000000000,Response: R3
35,90974400.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
36,91116600.00000000000000000000,Response: R1
37,91320900.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
38,91457900.00000000000000000000,Response: R3
39,100974100.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
40,101116300.00000000000000000000,Response: R1
41,101320600.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
42,101457700.00000000000000000000,Response: R3
43,110973900.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
44,111116100.00000000000000000000,Response: R1
45,111320400.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
46,111457400.00000000000000000000,Response: R3
47,120973600.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
48,121115800.00000000000000000000,Response: R1
49,121320100.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
50,121457200.00000000000000000000,Response: R3
51,130975900.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
52,131118200.00000000000000000000,Response: R1
53,131322500.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
54,131459500.00000000000000000000,Response: R3
55,140975700.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
56,141117900.00000000000000000000,Response: R1
57,141322200.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
58,141459300.00000000000000000000,Response: R3
59,150975400.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
60,151117700.00000000000000000000,Response: R1
61,151321900.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
62,151459000.00000000000000000000,Response: R3
63,160975200.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
64,161117400.00000000000000000000,Response: R1
65,161321700.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
66,161458700.00000000000000000000,Response: R3
67,170974900.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
68,171117200.00000000000000000000,Response: R1
69,171321400.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
70,171458500.00000000000000000000,Response: R3
71,180977300.00000000000000000000,CMD55 (APP_CMD): Next command is an application-specific command
72,181119500.00000000000000000000,Response: R1
73,181323800.00000000000000000000,ACMD41 (SD_SEND_OP_COND): Send HCS info and activate the card init process
74,181460800.00000000000000000000,Response: R3
75,181672900.00000000000000000000,CMD2 (ALL_SEND_CID): Ask card for CID number
76,181809900.00000000000000000000,Response: R2
77,182246900.00000000000000000000,CMD3 (SEND_RELATIVE_ADDR): Ask card for new relative card address (RCA)
78,182391800.00000000000000000000,Response: R6
79,182598600.00000000000000000000,CMD9 (SEND_CSD): Send card-specific data (CSD)
80,182738300.00000000000000000000,Response: R2
81,183183000.00000000000000000000,CMD7 (SELECT/DESELECT_CARD): Select / deselect card
82,183322700.00000000000000000000,Response: R6




回复 支持 反对

使用道具 举报

  • TA的每日心情
    奋斗
    2021-5-28 05:36
  • 签到天数: 1 天

    [LV.1]初来乍到

    2

    主题

    36

    帖子

    0

    注册会员

    Rank: 2

    积分
    132
    最后登录
    2024-2-23
    发表于 2023-12-20 09:13:15 | 显示全部楼层
    有好使的就比对一下就完了,6根线就可以的
    干不完的事
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    慵懒
    2024-2-8 09:39
  • 签到天数: 217 天

    [LV.7]常住居民III

    92

    主题

    1114

    帖子

    29

    版主

    Rank: 7Rank: 7Rank: 7

    积分
    7670

    热心会员

    最后登录
    2024-4-28
    发表于 2023-12-20 09:25:20 | 显示全部楼层
    如果你没有电源切换的话,需要把电源切换的代码给屏蔽掉
    https://www.nxpic.org.cn/module/forum/thread-801982-1-1.html
    该会员没有填写今日想说内容.
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    1

    主题

    6

    帖子

    0

    注册会员

    Rank: 2

    积分
    51
    最后登录
    2024-1-4
     楼主| 发表于 2024-1-2 14:59:17 | 显示全部楼层
    感谢,问题已解决,是我移植的问题,官方SDK可以跑通,屏蔽了电源切换,使用data进行sdcard检测
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2024-4-28 08:50 , Processed in 0.122535 second(s), 24 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表