USB MSC code, windows not able to access drive.

I am using the USB MSC code in my project. The project works fine and I am able to see the file system mounted and file being created in the logs. When I plug in the device into my laptop, I can see the device as a drive. However, when I click to access the drive, it asks me to format the drive and I am not able to view the contents of the drive. What might be causing this issue?

Parents Reply
  • Hi Snehal

    The .size set by default is for a 64Mbit flash (8 MByte). 1024*1024 = 1 MB, so you can multipy that with how many MB the used flash device is. Since 4Mbit is the same as 0.5 MB, the .size should be set to 0.5 * 1024 *1024, or 512 * 1024 simplified. MSC_WORKBUFFER_SIZE is the buffer that gets actual payload from the USB. This buffer is subdivided into 2 smaller buffers and they should have the size of a single block.

    Best regards,

    Simon

Children
Related