完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我使用最新的(2017)USB主机MSD堆栈从MLA与PIC24E @ 120兆赫。它工作得很好,但是我注意到创建一个新文件需要1.1秒。这并不重要,除了MSD堆栈块在此过程中,该设备有一个UI需要保持响应。读和写取和50毫秒,所以问题只是文件创建。不同的USB棒也一样,有人碰到这个吗?我还没有深入到堆栈中去看看它到底在做什么。
以上来自于百度翻译 以下为原文 I'm using the latest (2017) USB host MSD stack from MLA with a PIC24E @ 120 MHz. It works fine, but I noticed that creating a new file takes ~1.1 seconds. That wouldn't matter, except the MSD stack blocks during this process, and the device has a UI that needs to remain responsive. Reads and writes take < 50 ms, so the issue is just with file creation. Different USB sticks perform the same. Has anyone run into this? I haven't delved deeply enough into the stack to see what exactly it's doing. |
|
相关推荐
12个回答
|
|
当使用旧版本,但我预计不会有太大的变化…我似乎记得大约1秒,创建每一个文件!我的另一个问题是,如果USB棒有很多文件,这真的减慢了事情。每次它从脂肪中分配某物,它从一开始就开始搜索。在FAT32上,脂肪覆盖了许多必须阅读的部分。这是非常缓慢的,它真正需要的是缓存索引在搜索过程中最后一次到达!为了处理阻塞问题,我从UbMeNe.c:UbSimultasks-()调用了我的StastTasks-()函数,它是通过UBTASSK()宏调用的。
以上来自于百度翻译 以下为原文 When using an older version but I expect not much has changed... I seem to remember about 1 second to create each file! The other issue I had was if the USB stick had a lot of files, this really slowed things down. Each time it allocated something from the FAT, it starts from the beginning and searches. On FAT32 the FAT covers an great number of sectors that must be read. This is very slow and all it really needed was to cache the index where it got to last time during in the search! To deal with the blocking problem, I called my SystemTasks() function from within USBMain.c : USBFuncTasks() which is called via the USBTask() macro. |
|
|
|
|
|
|
|
我发现禁用目录支持使文件创建速度提高了25%。
以上来自于百度翻译 以下为原文 I found that disabling directory support makes file creation ~25% faster. |
|
|
|
哦,很有趣。我刚刚搜索了一个搜索FAT Fsio.c:FATFUNEMPYTROUNTHORSE()的冒犯函数,我的评论是:HTTP://www. MigCHIP.COM/FUMMS/FUNDSPE/701734,但我从未尝试过,因为我打算尝试FATFS而不是Fsio.C.HTTP.//www. McCHIP.COM/FuMss/FordPas/7355。九十九
以上来自于百度翻译 以下为原文 Oh interesting. I just had a look for the offending function that searches the FAT FSIO.c : FATfindEmptyCluster() And my comments here: http://www.microchip.com/forums/FindPost/701734But I never did go further as I intended to try FATFS instead of FSIO.c. http://www.microchip.com/forums/FindPost/723599 |
|
|
|
我发现这个有趣的HTTP://www.嵌入式CODESO…NIPPET/FATFS FRO-PIC32,但对于PIC32编辑:添加PIC32注释
以上来自于百度翻译 以下为原文 I find this interesting http://www.embeddedcodeso...nippet/fatfs-for-pic32 though for Pic32 edit: add pic32 comment |
|
|
|
读完这一切让我觉得FatFS是该走的路。
以上来自于百度翻译 以下为原文 Reading through all of that makes me think FatFS is the way to go. |
|
|
|
我当然会把我的努力放在那个方向:-我想它也会更小!但我没有看到USB集成版本。我相信以上是SD。
以上来自于百度翻译 以下为原文 I would certainly put my effort in that direction :-) I think it will also be smaller! But I haven't seen a USB integrated version. I believe the above is for SD. |
|
|
|
我已经将FATFS集成到微芯片USB堆栈中。文件创建是250毫秒仍然很慢,但远比Fielo更好。代码大小约为3KB更小。
以上来自于百度翻译 以下为原文 I've integrated FatFS into the Microchip USB stack. File creation is ~250 ms. Still pretty slow, but far better than FILEIO. Code size is about 3KB smaller. |
|
|
|
哦,很好。你也已经实现了我见过的SD卡所讨论的多块读/写吗?原因是,对于USB来说,扇区已经分裂成更小的块了!你能和它分享吗?
以上来自于百度翻译 以下为原文 Oh good. Have you also implemented the multi-block read/write that I have seen discussed for SD cards? Of cause, for USB, the sectors are already split into smaller chunks! Can/will you share it? |
|
|
|
经过更多的实验之后,我对上面测量的时间提出了质疑。当我测量时,我正在插入/拔下USB棒。但我发现,如果我重置黑板,文件创建时间在几十毫秒,而不是几百。显然,USB棒需要一些时间来启动,然后才能访问它们吗?
以上来自于百度翻译 以下为原文 After more experimenting, I'm questioning the times I measured above. When I was measuring, I was plugging/unplugging the USB stick. But I found that if I reset the board instead, file creation times are in the tens of ms rather than hundreds. Apparently, the USB sticks take some time to boot up before you can access them? |
|
|
|
我已经附加了用于USB MSD的DISKIO .C端口。没有其他FATF文件需要修改。USB MSD堆栈具有依赖于MLA的FILIO,因此您必须包括它的头文件,但不需要Fielo源。
以上来自于百度翻译 以下为原文 I've attached the diskio.c port for USB MSD. No other FatFS files need to be modified. The USB MSD stack has a dependency on FILEIO from MLA, so you have to include its header files, but no FILEIO source is required. Edit: Updated with disk_ioctl fix for f_sync. Attachment(s) diskio.c (2.61 KB) - downloaded 35 times |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5234 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
670浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 14:56 , Processed in 1.397543 second(s), Total 70, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号