This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[FATFS] FA_OPEN_APPEND destroy first file content

Hello,

I am trying to run USBD_MSC example using PCA10056 board from SDK15.

It works fine, when creating new file on each button press. 

I modified code to create and append some data to file on button event. When using FAT file system, content of first created file always gets corrupted. When I switched to exFAT file system everything works fine. 

Can you help me point out what I am doing wrong? I share modified main.c file for this example. (in this example F1.txt will be corrupted)

Parents Reply
  • Hi,

     

    I have tried your example on a PCA10056 v1.0.0, with FAT file system (+ both fixes initially mentioned), and I am not able to reproduce this issue. Could you post logs, F1.TXT content, and other failure descriptions?

     

    Best regards,

    Håkon

Children
  • Logs from device:

    File content:

    When I create only one file, it works fine:

    Logs form device

    File content:

  • I have tried to recreate this issue at my end, but I am not able to see any corruption in the files.

    Do you see the same problem if you do this on other computers as well?

    Could you also tell me which version of the PCA10056 you have?

     

    Kind regards,

    Håkon

  • I am running into a very similar issue. 


    I have implemented the two known issue fixes, but was getting corruption on FATFS in the header of a file just by f_printf's.  

    I have since switched to exFat, the corruption no longer occurs in the top line of the text file, but deletes about 10 lines of log in the middle of the file, inserting many symbols and characters. This is very reproducible in my experimentation.