2018-05-15 03:26 AM
Hi
I use mass storage sample from STM32CubeF4 ver 1.21 pakageWhen I format a partition with a NTFS system file and copy a large file to it, if device resets during the copy, the partition is corrupted and requests formatting. in FAT32 an extFAT i dont have this problem!Has anyone ever encountered this problem? Please guide where is the problem?2018-05-15 03:47 AM
Not quite sure what it is writing too in this context.
As a starting point you should perhaps step back and validate that the Read/Write to the block storage media is working properly, ie that it consistently/correctly reads back the right data all the time, and that it reads back what was written. This can be quite an involved test if you haven't done mass storage or file system work before. But start with the block side, as the file system will go pear shaped if the structures don't get saved properly and things get corrupted.
2018-05-15 07:28 AM
Thank you for your reply
The given example works with the FAT32 and exFAT file system. This problem occurs only in the NTFS file system!2018-05-15 07:42 AM
I'm not sure why NTFS should be specifically different. It puts structures in the middle/end of the media, but basically issues will be with how it reports size (READ CAPACITY) and how the READ/WRITE, and support of multiple sectors, is implemented. Most frequently the inability of the mass storage devices to return the correct blocks with the correct content, is at the root of critical failures.
I would instrument the read/write routines (print block address/size info via SWV or USART) so they output block and size information, and during initial bring up do a CRC across individual sectors so you can prove the data written is the same as the data returned later.