#include <rtl.h>
int finit (
const char *drive); /* drive to initialize */
Description
The function finit initializes the Flash File System and
must be called before invoking any other file system function. The
parameter drive is a character pointer specifying
the drive to initialize.
The function is included in the library RL-FlashFS. The prototype
is defined in the file rtl.h.
The following values are allowed for drive:
drive
Initialized Drives
""
Default System drive as defined in the file
File_Config.c
NULL
All enabled drives
"F:" or "F0:"
Flash drive
"S:" or "S0:"
SPI Flash drive
"R:" or "R0:"
RAM drive
"M:" or "M0:"
Memory Card drive 0
"M1:"
Memory Card drive 1
"U:" or "U0:"
USB Flash drive 0
"U1:"
USB Flash drive 1
"N:" or "N0:"
NAND Flash drive 0
"N1:"
NAND Flash drive 1
Return Value
0 - No error.
1 - IO Error. IO/driver initialization failed, or there
is no media, or media initialization failed.
2 - Volume Error. Mount failed. For FAT this means
invalid MBR, boot record, or invalid FAT formatting.
3 - Driver Configuration Error. As a result of wrong
configuration settings in File_Lib.c
4 - Journal initialization failed. FAT was initialized,
but the FAT journal initialization failed. This could be due to the
lack of free space on the media or invalid journal structure. File
system is OK. Files can be opened, read, written, closed without
using the journal.
#include <rtl.h>
void main (void) {
finit (NULL); /* Initialize all enabled drives. */
}
#include <rtl.h>
#include <stdio.h>
void main (void) {
if (finit ("M") != 0) {
printf ("Initialization failed.\n");
printf ("The drive is not enabled in the file 'File_Config.h'\n");
}
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.