cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in MSC_Standalone example

mostafa z
Associate II
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?
6 REPLIES 6
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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Khouloud GARSI
Lead II
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.

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 19, 2018 at 07:54

Hi

Thank you very much for your reply

Yes, this project works correctly with the FAT32  and exFAT file systems. My problem here is when I format the partition with NTFS and copy a nearly 4 GB file onto an 8 GB capacity microSD, if I will restart or separate the device during the copy. Requests for formatting the corresponding partition in the reconnect, of course, sometimes after the complete copy of the file is also seen

Please, if possible, test this item and give me guidance

Posted on May 19, 2018 at 22:22

NTFS is not going to like unexpected removal. ST isn't going to be able to address underlying caching and coherency issues created by Microsoft.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mostafa z
Associate II
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.