Fx_File_Edit_Standalone Application Description

This application provides an example of FileX stack usage on NUCLEO-C071RB board, running in standalone mode (without ThreadX). It demonstrates how to create a Fat File system on the internal SRAM memory using FileX.

The application is designed to execute file operations on the SRAM-Disk device, it provides all required software code for properly managing it.

The application’s main calls the MX_FileX_Process() function that handles file operations. At this stage, all FileX resources are created and the SRAM driver is initialized. After that, the MX_FileX_Process will start by formatting the SRAM-Disk using FileX services. The resulting file system is a FAT32 compatible, with 128 bytes per sector.

Upon successful opening of the created SRAM-Disk media, FileX continue with creating a file called “STM32.TXT” into the root directory, then write into it some predefined data. Then file is re-opened in read only mode and content is checked.

To configure FileX in standalone mode, the following flags should be added in the "fx_user.h" file:

#define FX_SINGLE_THREAD
#define FX_STANDALONE_ENABLE

Expected success behavior

Successful operation is marked by a toggling green LED light.

Also, information regarding executing operation on the SRAM-Disk is printed to the serial port.

Error behaviors

On failure, an error message is printed to the serial port while the green LED is switched OFF.

Assumptions if any

None

Known limitations

None

Notes

  1. The created SRAM-Disk, is placed in SRAM (12 KB) starting from the (FX_SRAM_DISK_BASE_ADDRESS=@0x20001900).
  2. The size of the custom sector used in the application is 128 bytes instead of the standard 512 bytes.
  3. To optimize the application footprint, the following FileX configuration options should be enabled in the fx_user.h file:
  4. #define FX_DISABLE_ERROR_CHECKING
    #define FX_MEDIA_STATISTICS_DISABLE
    #define FX_DISABLE_FAST_OPEN
    #define FX_DISABLE_BUILD_OPTIONS
    #define FX_DISABLE_ONE_LINE_FUNCTION
    #define FX_DISABLE_CONSECUTIVE_DETECT

FileX/LevelX usage hints

Keywords

FileX, File System, FAT32, SRAM, SRAM-DISK

Hardware and Software environment

How to use it ?

In order to make the program work, you must do the following: