This application provides an example of FileX stack usage on P-NUCLEO-WB55 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 512 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
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.
On failure, the red LED is switched ON and the green LED is switched OFF.
None
None
- When calling the fx_media_format() API, it is highly recommended to understand all the parameters used by the API to correctly generate a valid filesystem.
FileX, File System, FAT32, SRAM, SRAM-DISK
-
This application runs on STM32WBxx devices.
-
This application has been tested with STMicroelectronics P-NUCLEO-WB55 boards Revision MB1355C-01 and can be easily tailored to any other supported device and development board.
-
This application uses USART1 to display logs, the hyperterminal configuration is as follows:
- BaudRate = 115200 baud
- Word Length = 8 Bits
- Stop Bit = 1
- Parity = none
- Flow control = None
In order to make the program work, you must do the following:
- Open your preferred toolchain
- Rebuild all files and load your image into target memory
- Run the application