AnsweredAssumed Answered

USB MSC Help Required

Question asked by weblar on Apr 26, 2012
Latest reply on Jul 17, 2013 by Daniel Chai

I'm adapting the msd_disk_twrk60n512 example project so that it uses the sd card as a backing store, rather than an internal buffer and I've come across a few issues.


Inside the Bulk_Transaction_Callback routine within the USB_MSC_DEVICE_GET_INFO case statement, I'm reading the IO_IOCTL_GET_BLOCK_SIZE and IO_IOCTL_GET_NUM_SECTORS values from the MFS partition, passing them into the device_lba_info_ptr structure. This seems to work ok but only reports the total space available on the card.


Within Windows, when the drive enumerates and I inspect it within the Computer Management console, it always reports that the disk has 100% free space. I know for a fact that there are a number of files already on the disk so I need a way of reporting only the free space available.


Should this be done within the Bulk_Transaction_Callback routine and if so, how would I go about reporting just the free space? I've attached a screenshot of what I mean - the drive in question appears as "E:" in the list.


Thanks in advance,