Skip to main content
mostafa z
Associate II
May 17, 2018
Question

Problem in MSC_Standalone example

  • May 17, 2018
  • 3 replies
  • 1317 views
Posted on May 17, 2018 at 12:13

Hi

I use mass storage sample from STM32Cube_FW_F4_V1.21.0\Projects\STM324xG_EVAL\Applications\USB_Device\MSC_Standalone

What kind of file systems does this example work?

Does it work with the NTFS file system?
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    May 17, 2018
    Posted on May 17, 2018 at 14:47

    A mass storage system that works properly will work with all file systems.

    NTFS can be more challenging as it uses the beginning, middle and end of the media for structures, compared to FAT that uses the front and moves from there to the end incrementally.

    If the implementation is broken, NTFS will break early. You should perhaps validate the implementation at a block read/write level first.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Khouloud GARSI
    Technical Moderator
    May 17, 2018
    Posted on May 17, 2018 at 15:54

    Hi

    z.mostafa

    ‌,

    I tested the '

    MSC_Standalone' application with a 4GB microSD card and it was working conveniently even with NTFS.

    For your case, is the example working with other file system?

    Khouloud.

    Tesla DeLorean
    Guru
    May 17, 2018
    Posted on May 17, 2018 at 17:47

    Microsoft really doesn't like people using NTFS for removable media (disks or flash drives) as their ability to detach/eject, and the journalling nature, is complicated. Pulling media from an active drive can results in coherency issues.

    It is going to be sensitive to GET CAPACITY returning the correct values, and the READ/WRITE allowing access to all the blocks described, off-by-one type issues here can result in access errors and failure. Also issues with block numbers and byte offsets, and constraints of 32-bit number space will induce failure. ST has addressed many of the byte/block offset and 32/64-bit representation issues, but these things can be traps for the unwary, or mis-casting of math computations.

    Seem to also remember key structures having checksums, so any discrepancies with write/read data integrity will also get flagged.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    mostafa z
    mostafa zAuthor
    Associate II
    June 28, 2018
    Posted on June 28, 2018 at 10:17

    Hello

    The problem I solved

    I said I would say that someone else might have this problem

    By changing the type of variable (scsi_blk_addr in usbd_msc.h using uint32_t format) to  (

    uint64_t)  the problem was solved.