FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2016 Threads] FreeRTOS+FAT: disk name? disk available space?Posted by dnadler on October 5, 2016 I had a quick look at FreeRTOS+FAT and didn't see a couple things we always need:
How much space is available on disk?
To avoid nasty accidents our applications must check for adequate disk space prior trying to create files.
What is the disk name?
We usually show the disk name (for inserted USB memory sticks and uSD cards especially).
Sorry if I missed the APIs for these functions?
Thanks,
Best Regards, Dave
FreeRTOS+FAT: disk name? disk available space?Posted by heinbali01 on October 5, 2016 Hi Dave,
Both the free diskspace and the volume label are available, although there is not an API for this.
I don't think that stdio has standard functions for this?
Here is how you can retrieve all information:
~~~~
pxSDDisk = FFSDDiskInit( mainSDCARDDISKNAME );
if( pxSDDisk != NULL )
{
FFIOManagert *pxIOManager = sddiskioman( pxSDDisk );
uint64t ullFreeBytes =
( uint64t ) pxIOManager->xPartition.ulFreeClusterCount *
pxIOManager->xPartition.ulSectorsPerCluster * 512ull;
FreeRTOSprintf( ( "Volume %-12.12s: Free clusters %lu total clusters %lu Free space %lu KBn",
pxIOManager->xPartition.pcVolumeLabel,
pxIOManager->xPartition.ulFreeClusterCount,
pxIOManager->xPartition.ulNumClusters,
( uint32_t ) ( ullFreeBytes / 1024ull ) ) );
}
~~~~
Is that enough?
Regards.
FreeRTOS+FAT: disk name? disk available space?Posted by dnadler on October 6, 2016 Thanks Hein - That's adequate, glad its accessible.
IMOH, Nice APIs would be better for such common requirements...
Thanks again,
Best Regards, Dave
FreeRTOS+FAT: disk name? disk available space?Posted by heinbali01 on October 6, 2016
Nice APIs would be better for such common requirements...
I Agree. Will you write a proposal?
When using ff_stdio.h, it should also be possible to retrieve information for a virtual drive, such as "/ram", a RAM-disk.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|