USB Device Mass Storage data refresh with MCF52252 MQX 3.4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Device Mass Storage data refresh with MCF52252 MQX 3.4

Jump to solution
3,862 Views
mikeu
Contributor I

I have built an application based on the device disk example.

I am able to have the device enumerate on a windows pc and look just like a thumb drive.

Using MFS I created a file on the disk and windows is able to read it with no errors.

The problem I am having is I update the file periodically but when I open it on the windows pc I only see the original file contents. I have verified that the file is modified correctly in the 52252 memory.

If I set a breakpoint on the USB_MSC_DEVICE_READ_REQUEST case in the Bulk_Transaction_Callback I never hit the breakpoint after the first time the file is opened on the windows pc. The only way i can see the updated file is to unplug the usb and then plug it back in to force it to enumerate.

 

Thoughts????

 

 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,850 Views
JuroV
NXP Employee
NXP Employee

Hi Mike,

 

no help here. The master is host side, so Windows manages write / read through cache. Its really up to windows when it will read contents of flash drive. Suspecting that device cannot write anything itself on USB, Windows does not have any reason to update file in its file cache.

View solution in original post

0 Kudos
Reply
4 Replies
1,850 Views
t_k
Contributor II

Hi Michael,

did you ever get this resolved?

I'm trying to do exactly as you were only with the 54418.

Thanks,

Travis

0 Kudos
Reply
1,851 Views
JuroV
NXP Employee
NXP Employee

Hi Mike,

 

no help here. The master is host side, so Windows manages write / read through cache. Its really up to windows when it will read contents of flash drive. Suspecting that device cannot write anything itself on USB, Windows does not have any reason to update file in its file cache.

0 Kudos
Reply
1,850 Views
Jarpba
Contributor II

Hi! There must be other ways to make windows refresh the data. Has anyone thought about disconnecting and reconnecting the usb in software? It is possible to write registers to set usb voltage so that the device disappears from windows. But after that it seems problematic to make the software reinitialise the usb mass storage device. In my application windows is allowed only to read files so disconnecting prematurely won't make any harm to files on device. Now advice is needed to accomplish reconnecting usb mass storage device without resetting the whole system (which works without physically disconnecting the device in the middle).

 

https://community.freescale.com/message/108224#108224

https://community.freescale.com/message/108224#108224

0 Kudos
Reply
1,850 Views
mikeu
Contributor I

Thanks for the input. I thought that may have been the case but was hoping I was missing something.

I wound up running the device as a virtual comm port for the setup mode instead of emulating a disk. Originally I wanted to avoid having to provide a driver and program for the pc side but you can't win them all. Thanks again for the information.

0 Kudos
Reply