History: fs_safe

This page describes all changes made to the fs_safe package, SafeFLASH, since its release.


5.13 (2021-07-09, 14:00):

  • Warnings removed.

5.12 (2021-02-26, 11:29):

  • Static wear leveling function can handle bad blocks if media driver returns the corresponding error code.
  • New error codes were introduced for BlockCopy: F_ERR_DRIVER_ERASE, F_ERR_DRIVER_READ, F_ERR_DRIVER_WRITE.
  • Prototypes of static wear levelling functions were moved to api_safe.h.
  • Static wear levelling configurations were moved to config_safe.h.
  • Removed fstaticw.h.

5.11 (2021-02-19, 12:03):

  • Bugfix: if an existing file was opened with mode 'w!', and f_flush() is called on the file, but it is not closed and a power failure occurrs, then next f_open() will return F_ERR_CRCERROR.
  • Bugfix: f_getfreespace() may calculate more used space than actual used space.

5.10r2 (2020-10-13, 11:39):

  • Updated api_fs_err.h to the latest.

5.10 (2020-09-04, 10:23):

  • Bugfix: if an existing file was opened with mode 'w', and f_flush() or f_close() is called on another file or f_mkdir(), f_rmdir(), f_rename()f_move(), f_delete() is called, then the original file content of first file got lost after reset or power failure.
  • f_stat(), f_filelength(), f_findfirst() and f_findnext() shows actual file size if file is opened for writing.

5.9 (2020-03-25, 17:30):

  • Eliminated compiler warnings.

5.8 (2019-12-03, 11:26):

  • F_ERR_DRIVER added to support low level driver errors.

5.7r3 (2019-08-27, 17:00):

  • Updated api_fs_err.h.

5.7r2 (2019-05-07, 17:00):

  • MISRA 2012: typo fixed in the Deviation report.

5.7 (2019-04-30, 19:00):

  • MISRA 2012: inaccurate suppression comments fixed.

5.6r2 (2019-02-13, 17:41):

  • Reports moved to hcc.

5.6 (2019-02-03, 22:30):

  • Fixed typo.

5.5 (2019-01-07, 13:00):

  • MISRA 2012: violations eliminated.

5.4 (2018-12-17, 20:40):

  • MISRA 2004: violations eliminated.

5.3 (2018-08-30, 09:13):

  • File can be opened for "r+" when already opened for "r" and vice versa.

5.2r2 (2018-08-29, 18:20):

  • Added document HTML link to the documentation folder.
  • Renamed history and document files to the package name.

5.2 (2018-02-12, 10:05):

  • Can be compiled when CAPI is used.

5.1 (2017-10-12, 08:45):

  • Test functions moved to separate product.

5.0 (2017-10-02, 09:45):

  • f_mountdrive() (redirected to fsm_mountdrive()) changed: instead of void * mountfunc it expects FS_DRVMOUNT mountfunc now, in order to avoid compiler warning in the user application when calling f_mountdrive().


  • FS_DESC_WRITE_ALIGN option added - descriptor cache updates will be aligned and written in the granularity defined by the configuration option


  • FS_DESC_WRITE_ALIGN option added - descriptor cache updates will be aligned and written in the granularity defined by the configuration option.


  • safe test functions only call string manipulating functions from psp_string.h.
  • modify test cases affected by FS_SAFE_CASE_SENSITIVE define.
  • fix compiler errors in case F_FILE_CHANGED_EVENT set to 1.


  • f_dotest() can run on different volume IDs.
  • fsm_memcpy() and fsm_memset() replaced by psp_memcpy() and psp_memset().
  • bugfix: failed to read in "r" mode if file was simultaneously opened in "a" (append) mode. Use case: open file in "a" and in "r", append to file, read whole file in "r" mode, in this case if less than sector size was appended to the file it was not possible to read from it anymore.


  • compiler warnings eliminated.


  • writing to "a", "a+", "w", "w+" files and concurrent access of these files and "r" files are handled identically as in standard C library
  • New test cases added to f_dotest() to cover this functionality.


  • testport_ram_s.c can be compiled with latest fs_safe_ram.


  • Discardable sectors are collected in a dedicated buffer to speed up _fg_flush() which is called after most of the filesystem operations. The size of this buffer is determined by the FS_DISCARD_BUF_SIZE config variable.


  • Keil RTX compatibility issue: mutex released before being deleted.


  • write tests will not fail if there is not enough space (check free space before writing).


  • file can be opened in "r" mode again if it is already open in "a" or "a+" mode.

4.11 r2:

  • api_fs_err.h updated.


  • more compilation warnings eliminated.


  • compilation warnings eliminated.


  • HCC_UNICODE in config_safe.h must be set to 0 or 1.


  • static analysis warning fixed.


  • HCC_UNICODE fixed.


  • Check for invalid file handle added because the use of it could crash the system.
  • f_fstat() added.
  • f_dotest() changed to test f_fstat().


  • f_dotest() changed to request for the sector size.


  • _fg_copychainintomirror() could not open files which were truncated at sector boundary.
  • f_dotest() tests extended to test the fix above.


  • testdrv_s.c compiles without warnings.


  • added static type modifier for local functions.


  • lower case OS functions converted to upper case in port_s.h.


  • task ID removed from f_releaseFS() call.


  • psp_time() renamed to psp_rtc().


  • use of oal_task_id instead of long.
  • cleanup.


  • Initial release.