完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我现在正在做一个带有SD卡和USB MSD接口的CAN数据记录器。有一些东西我还不太明白,或者不知道我是不是用正确的方式做了,但是这里是:我可以成功地把数据从PIC32/Hyror FS连接到USB上写入文本文件。数据被写入,但Windows没有“更新”所做的更改,直到我断开USB电缆并重新连接。我正在关闭FS文件,然后尝试从Windows打开它。
以上来自于百度翻译 以下为原文 Hi all, I'm currently working on a CAN data logger with an SD card and a USB MSD interface. There's something I don't understand quite yet or don't know if I'm doing it the right way, but here it goes: I can successfully write data to a text file from the PIC32 / HARMony FS while connected to USB. Data gets written but windows doesn't "update" the changes made until I disconnect the USB cable and reconnect it. And I am closing the file in the FS before trying to open it from windows. Any help is greatly appreciated ;:D |
|
相关推荐
12个回答
|
|
如果我记得正确,这是正常的行为:Microchip MLA用于在USB级别执行“分离”和“附加”,从而Windows会注意到这些变化。
以上来自于百度翻译 以下为原文 If I recall correctly, this is the normal behaviour: Microchip MLA used to perform a "Detach" and a "Attach" at the USB level, so that Windows would notice the changes... |
|
|
|
我怎样才能做一个和谐的附加/分离?谢谢你的快速回答
以上来自于百度翻译 以下为原文 How can I do an attach/detach in Harmony? Thanks for the fast answer |
|
|
|
唉,我没有线索…搜索一些类似上面名字的函数……“USBDetach”
以上来自于百度翻译 以下为原文 Ahem, I've got no clue... Search for some function with similar names as above... "USBAttach", "USBDetach" |
|
|
|
|
|
|
|
在Windows中枚举了USB MSD设备之后,它执行一系列读取以查找MSD设备上存在的文件系统的类型。它缓存此信息,一般不重新读取与文件系统相关的元数据。它只涉及写入操作时文件系统元数据的更新(写入)。因此,使用在PIC32上运行的和声FS对媒体进行的任何更改对于Windows主机都是不可见的,直到该元数据再次被读取为止。这可以通过强制USB重新枚举来实现。Ortho提供API执行USB附加/分离,例如UBS.DeVice附件()和UBSDEVICEXORDECH(),可以用来实现这一点。有一个演示演示了这种双重用途,是标准发布的和谐释放的一部分。它位于:ApvsUSB设备MSDYFSSYSPIFlash。这个演示使用一个开关来控制媒体之间的和谐的FS和Windows(通过USB MSD)的所有权。
以上来自于百度翻译 以下为原文 After the USB MSD device has been enumerated by the windows, it performs a series of reads to find the type of file system present on the MSD device. It caches this information and does not read the file system related metadata again generally. It only updates(writes) the filesystem metadata when a write operation is involved. So any changes done to the media using the Harmony FS running on PIC32 will not be visible to the windows host until this metadata is read again. This can be achieved by forcing a USB re-enumeration. Harmony provides APIs to perform USB attach/detach such as USB_DEVICE_Attach () and USB_DEVICE_Detach () which can be used to achieve this. There is an application demo that showcases this dual usage and is part of the standard demos of the Harmony release. It is located at: appsu***devicemsd_fs_spiflash. This demo uses a switch to control the ownership of the media between the Harmony FS and the windows(through USB MSD). |
|
|
|
是的,我要使用这些函数,我只需要找出一个避免恼人窗口弹出的方法:P谢谢你的答案
以上来自于百度翻译 以下为原文 Yes I'm gonna use those functions, I only need to figure out a way of avoiding the annoying windows popup :P Thanks for you answers |
|
|
|
如果我不知怎么能把SD分离到Windows会发生什么?
以上来自于百度翻译 以下为原文 What happens if I somehow could "detach the SD" to windows? |
|
|
|
你到底是什么意思?正如上面所说的,Windows可以“弹出”并刷新设备的目录:
以上来自于百度翻译 以下为原文 What do you mean exactly? As you said above, Windows may "popup" and refresh the device's directory :) |
|
|
|
是的,但是这会“杀死”我的HID设备句柄,并使PC软件变得混乱:P,所以如果强迫假“SD卡分离”会起作用。
以上来自于百度翻译 以下为原文 Yeah but that "kills" my HID device handle and makes the PC software a mess :P so maybe if forcing a fake "sd card detach" would do the trick |
|
|
|
我没有解释我自己,我有一个HID和MSD的USB设备。最初的想法是这个记录器将数据写入SD卡,而PC只是通过改变读取文件。我使用HID函数来发送命令和数据。
以上来自于百度翻译 以下为原文 I didn't explain myself, I have a USB device with HID & MSD. The original idea was that this logger writes data to the SD card and the PC just reads the file with the changes. I use the HID function to send commands and data. |
|
|
|
是的,然后我得到它,我也创造了这样的复合物,但从来没有执行分离等。所以我不确定你能做什么。理论上,你可以在HID信道上发送一个命令,导致“不知何故”MSD侧强制刷新,但是…我不确定。或者你可以通过HID检索目录不是很好但是…
以上来自于百度翻译 以下为原文 Yeah, then I got it I also created such composite things, but never had to perform Detach etc... so am not sure what you could do. In theory you could send a command on the HID channel causing "somehow" the MSD side to force a refresh but... am not sure. Or you could retrieve a DIRectory via HID not so nice but ... |
|
|
|
它确实有意义,因为MSD永远不会自己写数据。我发现了一种卸载驱动器然后再安装的方法。更新所有的书面更改
以上来自于百度翻译 以下为原文 It does make sense, because a MSD will never write data on it's own. I discovered a way of unmounting the drive then mounting it again. That does update all the written changes |
|
|
|
只有小组成员才能发言,加入小组>>
5248 浏览 9 评论
2036 浏览 8 评论
1956 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2264 浏览 5 评论
787浏览 1评论
678浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
604浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 20:07 , Processed in 1.698937 second(s), Total 98, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号