完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
本帖最后由 princepeng 于 2017-4-7 09:29 编辑
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); } |
|
相关推荐 |
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
嵌入式DSP教学实验箱操作教程:2-20 数模转换实验(模拟SPI总线输出电压值)
628 浏览 0 评论
目前在2837x系列用的最多的、性能最好、性价比最高的是哪一款?
403 浏览 0 评论
国产嵌入式DSP教学实验箱_操作教程:22-AD采集DA输出实验(采集输出正弦波)
1596 浏览 0 评论
2336 浏览 0 评论
使用CCS6.0尝试给TMS320VC5502进行配置的时候找不到对应芯片的选项,该怎么麽办呀?
2286 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-29 04:35 , Processed in 0.342473 second(s), Total 39, Slave 33 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号