完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
早上好,我正在使用PIC32MX230f06B,我想实现u***主机与u***大容量存储设备的连接。实际上,我可以用USB主机芯片库连接到设备。使用MDDFS接口库我也可以写到我的u***笔驱动程序。现在我想读取设备中的所有内容(即从根目录开始的所有文件和文件夹)。这是我为测试如何执行而实现的部分代码。问题是,我什么都不能读:file.fileName总是NULL。
以上来自于百度翻译 以下为原文 Good morning. I'm using PIC32MX230f06B, and I want to realize u*** host applciation able to connect with u*** mass storage device. Actually I can connect to device with u*** host Microchip library. Using the MDDFS Interface Library I can also write to my u*** pen driver. Now I want to read all content in device (i.e. all file and folder starting from the root). This is the partial code that I have implemented to test how to do //if thumbdrive is plugged in if(USBHostMSDSCSIMediaDetect()) { deviceAttached = TRUE; //now a device is attached //See if the device is attached and in the right format if(FSInit()) { //Main root FSchdir("//"); char pointer; //pointer = FSgetcwd (NULL, NULL); SearchRec file; unsigned char attributes = ATTR_MASK; char name[] = "*.*"; // Find any file or directory if (FindFirst (name, attributes, &file)) { ris = ris | ( 0b1<<1 ); } // Find the next file or directory if( FindNext (&file)) { ris = ris | ( 0b1<<2 ); } while (deviceAttached == TRUE){ if(USBHostMSDSCSIMediaDetect()){ deviceAttached = TRUE; }else{ deviceAttached = FALSE; } } The problem is that I can't read anything: file.fileName is always NULL. Any information you can provide me would be greatly appreciated |
|
相关推荐
2个回答
|
|
|
|
|
|
|
|
|
很不幸,这两者我都没收到。在调试我的程序时,我发现FindFirst以CE_BADCACHEREAD错误参数结束。为什么会这样?
以上来自于百度翻译 以下为原文 Unfortunately I can't receive anything in both. Debugging my program I have found that FindFirst ended with CE_BADCACHEREAD error parameter. Why is it so? |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5808 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3543 浏览 3 评论
1155浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1119浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
887浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 04:41 , Processed in 1.350719 second(s), Total 76, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
9463