1 Reply Latest reply on Aug 23, 2019 4:45 AM by SudheeshK_26

    Is it possible to force format a flash file system?


      We are using Cypress FFS for cypress S25FL164 chip.


      We have an issue that, the files in the SPI chip are no longer accessible after period of time. We suspect some data could be corrupted (log file?)


      Below are our investigations:

      During power up, ionFS_zero_init() and ionFS_init() are successful.

      But FFS Partition and Volume API functions such as ionFS_mount and ionFS_get_sectors always return IO Error (IONFS_EIO = -6).


      The only workaround is to perform a low level full chip erase on the SPI Flash chip. After full chip erase, mount() function will return "File system was not formatted" (IONFS_ENOFMT = -33) and the format command is able create a volume and partition successfully.



      a) What is this IO Error and typically, what are the recommended steps to recover this issue?

      b)  Is it possible to force format a volume? --- ionFS_format function requires the number of available sectors and we retrieve using ionFS_get_sectors() function which will return IO Error (IONFS_EIO = -6).


      Appreciate any feedback!

        • 1. Re: Is it possible to force format a flash file system?



          One of the reasons to get IO Error (IONFS_EIO = -6) is when FFS is not able to communicate properly with flash device. Since you are observing this issue only after power up, I suspect you are not waiting enough before accessing the flash. Please see power up and power down requirements in datasheet, https://www.cypress.com/file/196886/download page 24. I have pasted the screenshot below.

          Please make sure that you are waiting for more than 10ms before trying to mount the file system from flash device.


          Also, please let me know, if you are trying to perform any other operations to flash device before trying to mount it after power up?


          Thanks and Regards,