How it works with FreeRTOS

Reliance Edge is an official FreeRTOS™ component that brings best-in-class fail safety to real-time operating systems across industries.

FreeRTOS does not include a virtual filesystem (VFS). This means a program using Reliance Edge must directly call the Reliance Edge public API’s instead of using a VFS interface such as fopen(). Similarly, FreeRTOS does not implement a block device abstraction layer. Reliance Edge must be configured to interact directly with the underlying storage media to perform block device I/O. Several example block device implementations are provided to demonstrate how (see file: os/freertos/services/osbdev.c).

Reliance Edge for FREERTOS implementation options

  • Atmel Studio Framework (ASF) SD/MMC – allows Reliance Edge to access SD/MMC media on an Atmel platform using the ASF drivers
  • STM32 SDIO – allows Reliance Edge to access SD/MMC media on an ST Microelectronics platform using the STM32Cube drivers
  • F_DRIVER – bridge to use the FAT SL block device implementation
  • FatFs – bridge to use the ChaN FatFs block device
  • RAM disk – allows Reliance Edge to run on a virtual volume created in RAM

* Reliance Edge also integrates with FreeRTOS by using a FreeRTOS mutex to ensure thread safety. It will automatically use either xSemaphoreCreateMutex or xSemaphoreCreateMutexStatic, depending on which is available.

How Reliance Edge compares
to other file systems used with FreeRTOS

Besides Reliance Edge, the two popular filesystems used on FreeRTOS are FatFs, developed by ChaN, and FAT SL (Super Lean).

  • File system API(s)
  • Supports multi-sector I/O
  • Minimum code size (ROM)
  • Minimum memory usage (RAM)
  • Transactional reliability
  • CRC metadata protection
  • Configurability

Reliance Edge

  • POSIX-Like or file system essentials
  • Yes
  • ~12 KB
  • ~4 KB
  • Yes
  • Yes
  • File system API's and on-disk format highly configurable at compile time; transactional behavior configurable at runtime

FatFs

  • POSIX-like
  • Yes
  • ~5 KB
  • ~1 KB
  • No
  • No
  • File system API's and some behavior configurable at compile time

FAT SL

  • POSIX-Like
  • No
  • 4 KB
  • <1 KB
  • No
  • No
  • Minimally configurable at compile time

For a generic comparison of Reliance Edge vs FAT and other file systems, see the Product Introduction of the Reliance Edge Developer’s Guide.

Reliance Edge delivers strong read and write performance compared to FatFs and FAT SL on FreeRTOS. It also prevents data loss due to power interruption, something that FatFs and FAT SL are vulnerable to.

We benchmarked performance using our general purpose file system I/O test (FSIOTest), which measures a variety of file I/O types and works with virtually any file system. Each file system was configured to use a 4096-byte block size. In the real world, especially in IoT devices, I/O sizes are often small, so the performance advantage offered by Reliance Edge when the write sizes are smaller than the block size is particularly meaningful.

Reliance Edge was configured to transact on fsync, file close, disk full and volume dismount. For the FatFs file system, the “fast seek” feature was enabled, which caches many of the FAT entries to improve performance. FAT SL does not have that option, and overall performance suffered as a result.

Tuxera Reliance Edge reads faster on small reads
Tuxera Reliance Edge writes faster