TI论坛
直播中

李昕羿

7年用户 173经验值
私信 关注
[问答]

请问5509A读取SD卡阻塞该怎么办?

SD卡是1G的FAT32格式的
我是调用CSL库函数进行操作的,在例程中加入MMC_read函数程序貌似就卡住了,查看了下网上的资料感觉像是阻塞,具体现象如下:
正常现象:
MMC Controller setup test...
SD card found
Asking SD card for its RCA...
RCA sent is 0xb368
Initialized card successfully
TEST PASSED
加了MMC_read函数的现象
MMC Controller setup test...
SD card found
Asking SD card for its RCA...
RCA sent is 0x

程序代码:
void main()
[
  Uint16 mybuf[256],i,mybuf1[256];
  CSL_init();
  PLL_config(&myConfig);
  printf ("MMC Controller setup test...n");
  mmc0 = MMC_open(MMC_DEV1);
  MMC_setupNative(mmc0,&Init); //initialize the MMC controller
//  MMC_getConfig(mmc0,&test);
  MMC_sendGoIdle(mmc0); //Sends a broadcast GO_IDLE command
  for (count=0;count<4016;count++)
  asm("        NOP");
  cardtype = MMC_sendOpCond(mmc0,0x00100000); //Sets the operating voltage window while in Native mode
  if (cardtype == 0xFFFF)[
     printf ("Card not recognizedn");
     exit(0);
  ]
  //MMC_setCardType(card, cardtype);
  if (cardtype == MMC_CARD)[
     printf ("Setting 10 as RCA valuen");
     cid = &cardid;
     /* Instruct all cards to send their Card Identification Data    */
     MMC_sendAllCID(mmc0,cid); // get the CID structure for all cards.
     card = &cardalloc;
     //retVal = MMC_setRca(mmc0,card,0x8DAB);
     retVal = MMC_setRca(mmc0,card,2);
     /* The host can request for the CSD in the standby state. This   *
      * structure contains the data outlined below                    */
     printf ("Reading CSD structure for MMC cardn");
     csd = &cardcsd;
     retVal=MMC_sendCSD(mmc0);
     MMC_getCardCsd(mmc0, csd);
  ] else [
     printf ("SD card foundn");
     cid = &cardid;

     /* Instruct all cards to send their Card Identification Data    */
     SD_sendAllCID(mmc0,cid);
//     printf ("The values in the CID of the SD card are:n");

     printf ("Asking SD card for its RCA...n");
     card = &cardalloc;
     rca = SD_sendRca(mmc0,card);
     printf ("RCA sent is 0x%xn", rca);

     /* The host can request for the CSD in the standby state. This   *
      * structure contains the data outlined below                    */

     retVal = MMC_sendCSD(mmc0);
//     sdcsd = &sdcardcsd;
//     SD_getCardCsd(mmc0, sdcsd);
  ]

  retVal = MMC_selectCard(mmc0,card);
  MMC_read(mmc0,0x238200,mybuf,256);
  for(i=0;i<6000;i++);
  printf ("Initialized card successfullyn");
  printf ("TEST PASSEDn");
  while(1);

]

回帖(8)

余少虹

2019-10-25 09:22:59
C5509A CSL不支持SDHC FAT32格式。
举报

李昕羿

2019-10-25 09:39:43
引用: vuywsdfwf 发表于 2019-10-25 14:21
C5509A CSL不支持SDHC FAT32格式。

那请问下我在格式化SD卡时,需要格式化成什么格式?我是win10系统,可选的格式化的文件格式是1、NTFS 2、FAT(默认) 3、FAT32 4、exFAT
我看了下我的SD卡,是1GB的,应该不是SDHC吧
举报

余少虹

2019-10-25 09:45:00
引用: lan876 发表于 2019-10-25 14:38
那请问下我在格式化SD卡时,需要格式化成什么格式?我是win10系统,可选的格式化的文件格式是1、NTFS 2、FAT(默认) 3、FAT32 4、exFAT
我看了下我的SD卡,是1GB的,应该不是SDHC吧

对,你的卡1GB不是SDHC,选择2. FAT(默认) 。
举报

李昕羿

2019-10-25 09:56:19
引用: vuywsdfwf 发表于 2019-10-25 14:43
对,你的卡1GB不是SDHC,选择2. FAT(默认) 。

将SD卡格式化为FAT(默认),分配单元大小选为16KB和默认配置大小分别尝试了下,还是之前的现象
MMC Controller setup test...
SD card found
Asking SD card for its RCA...
RCA sent is 0x 
请问下该怎么办?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分