Hello All,
I am working with freertos and I am trying to add to the file system several partitions inside a pxDisk (SD card) with different names.
I have partititioned the pxDisk in two partitions, after that I format and mount each partition without problem, but when using FF_FS_Add, I don’t have any way to select the partition to Add.
I have used the ‘active partition field’ pxDisk->xStatus.bPartitionNumber = partno;
For example:
pxDisk->xStatus.bPartitionNumber = 0
FF_FS_Add( pcName0, pxDisk );
pxDisk->xStatus.bPartitionNumber = 1
FF_FS_Add( pcName1, pxDisk );
However when I ulse FTP to check the filesystem it seems that both names ‘pcname0’ and ‘pcname1’ points to the same filesystem.
How can I use FF_FS_Add() with two partitions inside the same media pxDisk?
If I use two different pxDisk structures, there is some example where different pxDisk structures point to the same SD card ? how to do the partition in such case ? only with in one pxDisk structure?
Hi @przrtos
Welcome to FreeRTOS Community Forums !
The issue might be reusing the same pxDisk pointer and expect FF_FS_Add() to distinguish partitions.
You can try creating two FF_Disk_t structures -one per partition-even if they share the same physical media.
Hi karahulx,
Many thanks for you response,
If my SD driver has no partition and I want to create two partitions, must I use FF_Partition( pxDisk, &xPartition ); and FF_Format( pxDisk, partnumber, pdFALSE, pdFALSE ); in both pxDisk0 and pxDisk1 ? or only in one of them ?
FF_Partition() writes to sector 0 (MBR) . Formatting writes to a specific partition region - this can be done by reusing the same disk handle with the right partition number.
You must not run FF_Partition() more than once unless you intend to destroy the partition table again.
FF_Mount()must be called per FF_Disk_t, using the partition number set in that disk.
So when try to setup the second partition on the second disk structure , you should call FF_Mount() on pxDisk1