I guess there’s a little misunderstanding here regarding the usage of FileX Partitions.
The concept of partitions in FileX basically refers to logical divisions within a single file system instance rather than the physical partitions on the storage device.
We may arrange and manage files within a single file system instance using FileX because partitions are maintained by the file system itself. But FileX does not offer direct APIs for partitioning a storage disk into several physical sections.
If we want to create multiple logical partitions within a single FileX file system instance, we can try it by following these steps:
1) Initialization of FileX: Initially, we can initialize the FileX file system using the fx_media_open function to specify the underlying media driver such as NOR flash, etc.
2) Formatting Media: This step refers to initialization the file system structures on the media. We can try formatting it using the fx_media_format function to prepare it for use with FileX.
3) Mountting the File System: After formatting the media, we can mount the file system using the fx_media_mount function. This makes the file system accessible for file operations.
4) Directories Creation: We can create directories using the fx_directory_create function, within the mounted files. These directories serve as logical partitions within the file system instance.
5) File Creation and Management: Proceeding with these steps, then we can finally try creating and managing files within the directories/partitions using the various file management APIs provided by FileX, such as fx_file_create, fx_file_read, fx_file_write, etc.
The _fx_partition_offset_calculate function mentioned above, is used to calculate the offset of a specific partition within the file system. This function takes the partition number as input and returns the start offset and size of the partition.
Hope this answer is helpful! :)