ChibiOS/HAL  6.1.0
Managed Flash Storage Driver

Managed Flash Storage Driver. More...

Collaboration diagram for Managed Flash Storage Driver:

Detailed Description

Managed Flash Storage Driver.

This module implements a managed flash storage able to store a finite number of variable-size records. Records are retrieved by their index number.
The driver is automatically performs:

Macros

#define RET_ON_ERROR(err)
 Error check helper. More...
 

Configuration options

#define MFS_CFG_MAX_RECORDS   32
 Maximum number of indexed records in the managed storage. More...
 
#define MFS_CFG_MAX_REPAIR_ATTEMPTS   3
 Maximum number of repair attempts on partition mount. More...
 
#define MFS_CFG_WRITE_VERIFY   TRUE
 Verify written data. More...
 
#define MFS_CFG_STRONG_CHECKING   TRUE
 Enables a stronger and slower check procedure on mount. More...
 
#define MFS_CFG_BUFFER_SIZE   32
 Size of the buffer used for data copying. More...
 

Error codes handling macros

#define MFS_IS_ERROR(err)   ((err) < MFS_NO_ERROR)
 
#define MFS_IS_WARNING(err)   ((err) > MFS_NO_ERROR)
 

Typedefs

typedef uint32_t mfs_id_t
 Type of a record identifier. More...
 

Data Structures

union  mfs_bank_header_t
 Type of a bank header. More...
 
union  mfs_data_header_t
 Type of a data block header. More...
 
struct  MFSConfig
 Type of a MFS configuration structure. More...
 
struct  MFSDriver
 Type of an MFS instance. More...
 

Functions

static mfs_error_t mfs_flash_read (MFSDriver *mfsp, flash_offset_t offset, size_t n, uint8_t *rp)
 Flash read. More...
 
static mfs_error_t mfs_flash_write (MFSDriver *mfsp, flash_offset_t offset, size_t n, const uint8_t *wp)
 Flash write. More...
 
static mfs_error_t mfs_flash_copy (MFSDriver *mfsp, flash_offset_t doffset, flash_offset_t soffset, uint32_t n)
 Flash copy. More...
 
static mfs_error_t mfs_record_check (MFSDriver *mfsp, mfs_data_header_t *dhdrp, flash_offset_t offset, flash_offset_t limit, mfs_record_state_t *sts)
 Verifies integrity of a record. More...
 
static mfs_error_t mfs_bank_erase (MFSDriver *mfsp, mfs_bank_t bank)
 Erases and verifies all sectors belonging to a bank. More...
 
static mfs_error_t mfs_bank_verify_erase (MFSDriver *mfsp, mfs_bank_t bank)
 Erases and verifies all sectors belonging to a bank. More...
 
static mfs_error_t mfs_bank_write_header (MFSDriver *mfsp, mfs_bank_t bank, uint32_t cnt)
 Writes the validation header in a bank. More...
 
static mfs_error_t mfs_bank_scan_records (MFSDriver *mfsp, mfs_bank_t bank, mfs_bank_state_t *statep)
 Scans blocks searching for records. More...
 
static mfs_error_t mfs_bank_get_state (MFSDriver *mfsp, mfs_bank_t bank, mfs_bank_state_t *statep, uint32_t *cntp)
 Determines the state of a bank. More...
 
static mfs_error_t mfs_bank_mount (MFSDriver *mfsp, mfs_bank_t bank, mfs_bank_state_t *statep)
 Selects a bank as current. More...
 
static mfs_error_t mfs_garbage_collect (MFSDriver *mfsp)
 Enforces a garbage collection. More...
 
static mfs_error_t mfs_try_mount (MFSDriver *mfsp)
 Performs a flash partition mount attempt. More...
 
mfs_error_t mfs_mount (MFSDriver *mfsp)
 Configures and activates a MFS driver. More...
 
void mfsObjectInit (MFSDriver *mfsp)
 Initializes an instance. More...
 
mfs_error_t mfsStart (MFSDriver *mfsp, const MFSConfig *config)
 Configures and activates a MFS driver. More...
 
void mfsStop (MFSDriver *mfsp)
 Deactivates a MFS driver. More...
 
mfs_error_t mfsErase (MFSDriver *mfsp)
 Destroys the state of the managed storage by erasing the flash. More...
 
mfs_error_t mfsReadRecord (MFSDriver *mfsp, mfs_id_t id, size_t *np, uint8_t *buffer)
 Retrieves and reads a data record. More...
 
mfs_error_t mfsWriteRecord (MFSDriver *mfsp, mfs_id_t id, size_t n, const uint8_t *buffer)
 Creates or updates a data record. More...
 
mfs_error_t mfsEraseRecord (MFSDriver *mfsp, mfs_id_t id)
 Erases a data record. More...
 
mfs_error_t mfsPerformGarbageCollection (MFSDriver *mfsp)
 Enforces a garbage collection operation. More...
 

Enumerations

Macro Definition Documentation

#define RET_ON_ERROR (   err)
Value:
do { \
mfs_error_t e = (err); \
if (e != MFS_NO_ERROR) { \
return e; \
} \
} while (false)
mfs_error_t
Type of an MFS error code.
Definition: mfs.h:140

Error check helper.

Definition at line 52 of file mfs.c.

Referenced by mfs_bank_get_state(), mfs_bank_mount(), mfs_bank_scan_records(), mfs_flash_copy(), mfs_flash_write(), mfs_garbage_collect(), mfs_try_mount(), mfsErase(), mfsEraseRecord(), mfsReadRecord(), and mfsWriteRecord().

#define MFS_CFG_MAX_RECORDS   32

Maximum number of indexed records in the managed storage.

Note
Record indexes go from 0 to MFS_CFG_MAX_RECORDS - 1.

Definition at line 54 of file mfs.h.

Referenced by mfs_bank_mount(), mfs_garbage_collect(), mfs_record_check(), mfsEraseRecord(), mfsReadRecord(), and mfsWriteRecord().

#define MFS_CFG_MAX_REPAIR_ATTEMPTS   3

Maximum number of repair attempts on partition mount.

Definition at line 61 of file mfs.h.

Referenced by mfs_mount().

#define MFS_CFG_WRITE_VERIFY   TRUE

Verify written data.

Definition at line 68 of file mfs.h.

#define MFS_CFG_STRONG_CHECKING   TRUE

Enables a stronger and slower check procedure on mount.

Strong checking requires reading of the whole written data and this can be slow, normal checking only checks integrity of metadata, data errors would be detected on read.

Definition at line 78 of file mfs.h.

#define MFS_CFG_BUFFER_SIZE   32

Size of the buffer used for data copying.

Note
The buffer size must be a power of two and not smaller than 16 bytes.
Larger buffers improve performance, buffers with size multiple of the flash program page size work better.

Definition at line 89 of file mfs.h.

Referenced by mfs_flash_copy(), and mfs_flash_write().

Typedef Documentation

typedef uint32_t mfs_id_t

Type of a record identifier.

Definition at line 176 of file mfs.h.

Enumeration Type Documentation

enum mfs_bank_t

Type of a flash bank.

Definition at line 120 of file mfs.h.

Type of driver state machine states.

Definition at line 128 of file mfs.h.

Type of an MFS error code.

Note
Errors are negative integers, informative warnings are positive integers.

Definition at line 140 of file mfs.h.

Type of a bank state assessment.

Definition at line 156 of file mfs.h.

Type of a record state assessment.

Definition at line 166 of file mfs.h.

Function Documentation

static mfs_error_t mfs_flash_read ( MFSDriver mfsp,
flash_offset_t  offset,
size_t  n,
uint8_t *  rp 
)
static

Flash read.

Parameters
[in]mfsppointer to the MFSDriver object
[in]offsetflash offset
[in]nnumber of bytes to be read
[out]rppointer to the data buffer
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 151 of file mfs.c.

References MFSDriver::config, MFSConfig::flashp, flashRead, and MFSDriver::state.

Referenced by mfs_bank_get_state(), mfs_bank_scan_records(), mfs_flash_copy(), mfs_flash_write(), and mfsReadRecord().

static mfs_error_t mfs_flash_write ( MFSDriver mfsp,
flash_offset_t  offset,
size_t  n,
const uint8_t *  wp 
)
static

Flash write.

Note
If the option MFS_CFG_WRITE_VERIFY is enabled then the flash is also read back for verification.
Parameters
[in]mfsppointer to the MFSDriver object
[in]offsetflash offset
[in]nnumber of bytes to be written
[in]wppointer to the data buffer
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 177 of file mfs.c.

References MFSDriver::buffer, MFSDriver::config, MFSConfig::flashp, flashProgram, MFS_CFG_BUFFER_SIZE, mfs_flash_read(), RET_ON_ERROR, and MFSDriver::state.

Referenced by mfs_bank_write_header(), mfs_flash_copy(), mfsEraseRecord(), and mfsWriteRecord().

Here is the call graph for this function:

static mfs_error_t mfs_flash_copy ( MFSDriver mfsp,
flash_offset_t  doffset,
flash_offset_t  soffset,
uint32_t  n 
)
static

Flash copy.

Note
If the option MFS_CFG_WRITE_VERIFY is enabled then the flash is also read back for verification.
Parameters
[in]mfsppointer to the MFSDriver object
[in]doffsetdestination flash offset
[in]soffsetsource flash offset
[in]nnumber of bytes to be copied
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 220 of file mfs.c.

References MFSDriver::buffer, MFS_CFG_BUFFER_SIZE, mfs_flash_read(), mfs_flash_write(), and RET_ON_ERROR.

Referenced by mfs_garbage_collect().

Here is the call graph for this function:

static mfs_error_t mfs_record_check ( MFSDriver mfsp,
mfs_data_header_t dhdrp,
flash_offset_t  offset,
flash_offset_t  limit,
mfs_record_state_t sts 
)
static

Verifies integrity of a record.

Parameters
[in]mfsppointer to the MFSDriver object
[in]dhdrppointer to the header to be checked
[in]offsetflash offset of the header to be checked
[in]limitflash limit offset
[out]stsassessed record state
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 259 of file mfs.c.

References MFSDriver::config, MFSConfig::erased, mfs_data_header_t::id, mfs_data_header_t::magic, MFS_CFG_MAX_RECORDS, and mfs_data_header_t::size.

Referenced by mfs_bank_scan_records().

static mfs_error_t mfs_bank_erase ( MFSDriver mfsp,
mfs_bank_t  bank 
)
static

Erases and verifies all sectors belonging to a bank.

Parameters
[in]mfsppointer to the MFSDriver object
[in]bankbank to be erased
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 302 of file mfs.c.

References MFSConfig::bank0_sectors, MFSConfig::bank0_start, MFSConfig::bank1_sectors, MFSConfig::bank1_start, MFSDriver::config, MFSConfig::flashp, flashStartEraseSector, flashVerifyErase, flashWaitErase(), and MFSDriver::state.

Referenced by mfs_garbage_collect(), mfs_try_mount(), and mfsErase().

Here is the call graph for this function:

static mfs_error_t mfs_bank_verify_erase ( MFSDriver mfsp,
mfs_bank_t  bank 
)
static

Erases and verifies all sectors belonging to a bank.

Parameters
[in]mfsppointer to the MFSDriver object
[in]bankbank to be verified
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 348 of file mfs.c.

References MFSConfig::bank0_sectors, MFSConfig::bank0_start, MFSConfig::bank1_sectors, MFSConfig::bank1_start, MFSDriver::config, MFSConfig::flashp, flashVerifyErase, and MFSDriver::state.

Referenced by mfs_bank_get_state().

static mfs_error_t mfs_bank_write_header ( MFSDriver mfsp,
mfs_bank_t  bank,
uint32_t  cnt 
)
static

Writes the validation header in a bank.

Parameters
[in]mfsppointer to the MFSDriver object
[in]bankbank to be validated
[in]cntvalue for the flash usage counter
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
Function Class:Not an API, this function is for internal use only.

Definition at line 389 of file mfs.c.

References MFSConfig::bank0_start, MFSConfig::bank1_start, MFSDriver::config, mfs_bank_header_t::counter, mfs_bank_header_t::crc, MFSConfig::erased, flashGetSectorOffset(), MFSConfig::flashp, mfs_bank_header_t::magic1, mfs_bank_header_t::magic2, mfs_flash_write(), and mfs_bank_header_t::reserved1.

Referenced by mfs_garbage_collect(), and mfs_try_mount().

Here is the call graph for this function:

static mfs_error_t mfs_bank_scan_records ( MFSDriver mfsp,
mfs_bank_t  bank,
mfs_bank_state_t statep 
)
static

Scans blocks searching for records.

Note
The block integrity is strongly checked.
Parameters
[in]mfsppointer to the MFSDriver object
[in]bankthe bank identifier
[out]statepbank state, it can be:
  • MFS_BANK_PARTIAL
  • MFS_BANK_OK
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 430 of file mfs.c.

References MFSConfig::bank_size, MFSDriver::buffer, MFSDriver::config, MFSDriver::descriptors, mfs_data_header_t::id, mfs_flash_read(), mfs_record_check(), MFSDriver::next_offset, RET_ON_ERROR, and mfs_data_header_t::size.

Referenced by mfs_bank_mount().

Here is the call graph for this function:

static mfs_error_t mfs_bank_get_state ( MFSDriver mfsp,
mfs_bank_t  bank,
mfs_bank_state_t statep,
uint32_t *  cntp 
)
static

Determines the state of a bank.

Note
This function does not test the bank integrity by scanning the data area, it just checks the header.
Parameters
[in]mfsppointer to the MFSDriver object
[in]bankbank to be checked
[out]statepbank state, it can be:
  • MFS_BANK_ERASED
  • MFS_BANK_GARBAGE
  • MFS_BANK_OK
[out]cntpbank counter
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 521 of file mfs.c.

References MFSDriver::buffer, MFSDriver::config, mfs_bank_header_t::counter, mfs_bank_header_t::crc, MFSConfig::erased, mfs_bank_header_t::magic1, mfs_bank_header_t::magic2, mfs_bank_verify_erase(), mfs_flash_read(), mfs_bank_header_t::reserved1, and RET_ON_ERROR.

Referenced by mfs_bank_mount(), and mfs_try_mount().

Here is the call graph for this function:

static mfs_error_t mfs_bank_mount ( MFSDriver mfsp,
mfs_bank_t  bank,
mfs_bank_state_t statep 
)
static

Selects a bank as current.

Note
The bank header is assumed to be valid.
Parameters
[in]mfsppointer to the MFSDriver object
[in]bankbank to be scanned
[out]statepbank state, it can be:
  • MFS_BANK_ERASED
  • MFS_BANK_GARBAGE
  • MFS_BANK_PARTIAL
  • MFS_BANK_OK
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 589 of file mfs.c.

References MFSDriver::current_bank, MFSDriver::current_counter, MFSDriver::descriptors, mfs_bank_get_state(), mfs_bank_scan_records(), MFS_CFG_MAX_RECORDS, RET_ON_ERROR, and MFSDriver::used_space.

Referenced by mfs_try_mount().

Here is the call graph for this function:

static mfs_error_t mfs_garbage_collect ( MFSDriver mfsp)
static

Enforces a garbage collection.

Storage data is compacted into a single bank.

Parameters
[out]mfsppointer to the MFSDriver object
Returns
The operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 622 of file mfs.c.

References MFSDriver::current_bank, MFSDriver::current_counter, MFSDriver::descriptors, mfs_bank_erase(), mfs_bank_write_header(), MFS_CFG_MAX_RECORDS, mfs_flash_copy(), MFSDriver::next_offset, and RET_ON_ERROR.

Referenced by mfs_try_mount(), mfsEraseRecord(), mfsPerformGarbageCollection(), and mfsWriteRecord().

Here is the call graph for this function:

static mfs_error_t mfs_try_mount ( MFSDriver mfsp)
static

Performs a flash partition mount attempt.

Parameters
[in]mfsppointer to the MFSDriver object
Returns
The operation status.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 673 of file mfs.c.

References mfs_bank_erase(), mfs_bank_get_state(), mfs_bank_mount(), mfs_bank_write_header(), mfs_garbage_collect(), and RET_ON_ERROR.

Referenced by mfs_mount().

Here is the call graph for this function:

mfs_error_t mfs_mount ( MFSDriver mfsp)

Configures and activates a MFS driver.

Parameters
[in]mfsppointer to the MFSDriver object
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
MFS_WARN_GCif the operation triggered a garbage collection.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 793 of file mfs.c.

References MFS_CFG_MAX_REPAIR_ATTEMPTS, mfs_try_mount(), and MFSDriver::state.

Referenced by mfsErase(), and mfsStart().

Here is the call graph for this function:

void mfsObjectInit ( MFSDriver mfsp)

Initializes an instance.

Parameters
[out]mfsppointer to the MFSDriver object
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 832 of file mfs.c.

References MFSDriver::config, osalDbgCheck, and MFSDriver::state.

mfs_error_t mfsStart ( MFSDriver mfsp,
const MFSConfig config 
)

Configures and activates a MFS driver.

Parameters
[in]mfsppointer to the MFSDriver object
[in]configpointer to the configuration
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
MFS_WARN_GCif the operation triggered a garbage collection.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 854 of file mfs.c.

References MFSDriver::config, mfs_mount(), osalDbgAssert, osalDbgCheck, and MFSDriver::state.

Here is the call graph for this function:

void mfsStop ( MFSDriver mfsp)

Deactivates a MFS driver.

Parameters
[in]mfsppointer to the MFSDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 873 of file mfs.c.

References MFSDriver::config, osalDbgAssert, osalDbgCheck, and MFSDriver::state.

mfs_error_t mfsErase ( MFSDriver mfsp)

Destroys the state of the managed storage by erasing the flash.

Parameters
[in]mfsppointer to the MFSDriver object
Returns
The operation status.
Return values
MFS_ERR_INV_STATEif the driver is in not in MSG_READY state.
MFS_NO_ERRORif the operation has been successfully completed.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 896 of file mfs.c.

References mfs_bank_erase(), mfs_mount(), osalDbgCheck, RET_ON_ERROR, and MFSDriver::state.

Here is the call graph for this function:

mfs_error_t mfsReadRecord ( MFSDriver mfsp,
mfs_id_t  id,
size_t *  np,
uint8_t *  buffer 
)

Retrieves and reads a data record.

Parameters
[in]mfsppointer to the MFSDriver object
[in]idrecord numeric identifier, the valid range is between 1 and MFS_CFG_MAX_RECORDS
[in,out]npon input is the maximum buffer size, on return it is the size of the data copied into the buffer
[out]bufferpointer to a buffer for record data
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
MFS_ERR_INV_STATEif the driver is in not in MSG_READY state.
MFS_ERR_INV_SIZEif the passed buffer is not large enough to contain the record data.
MFS_ERR_NOT_FOUNDif the specified id does not exists.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 931 of file mfs.c.

References MFSDriver::buffer, mfs_data_header_t::crc, MFSDriver::descriptors, MFS_CFG_MAX_RECORDS, mfs_flash_read(), osalDbgCheck, RET_ON_ERROR, and MFSDriver::state.

Here is the call graph for this function:

mfs_error_t mfsWriteRecord ( MFSDriver mfsp,
mfs_id_t  id,
size_t  n,
const uint8_t *  buffer 
)

Creates or updates a data record.

Parameters
[in]mfsppointer to the MFSDriver object
[in]idrecord numeric identifier, the valid range is between 1 and MFS_CFG_MAX_RECORDS
[in]nsize of data to be written, it cannot be zero
[in]bufferpointer to a buffer for record data
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
MFS_WARN_GCif the operation triggered a garbage collection.
MFS_ERR_INV_STATEif the driver is in not in MSG_READY state.
MFS_ERR_OUT_OF_MEMif there is not enough flash space for the operation.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 996 of file mfs.c.

References MFSConfig::bank_size, MFSDriver::buffer, MFSDriver::config, mfs_data_header_t::crc, MFSDriver::current_bank, MFSDriver::descriptors, MFSConfig::erased, mfs_data_header_t::id, mfs_data_header_t::magic, MFS_CFG_MAX_RECORDS, mfs_flash_write(), mfs_garbage_collect(), MFSDriver::next_offset, osalDbgCheck, RET_ON_ERROR, mfs_data_header_t::size, MFSDriver::state, and MFSDriver::used_space.

Here is the call graph for this function:

mfs_error_t mfsEraseRecord ( MFSDriver mfsp,
mfs_id_t  id 
)

Erases a data record.

Parameters
[in]mfsppointer to the MFSDriver object
[in]idrecord numeric identifier, the valid range is between 1 and MFS_CFG_MAX_RECORDS
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
MFS_WARN_GCif the operation triggered a garbage collection.
MFS_ERR_INV_STATEif the driver is in not in MSG_READY state.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1084 of file mfs.c.

References MFSConfig::bank_size, MFSDriver::buffer, MFSDriver::config, mfs_data_header_t::crc, MFSDriver::current_bank, MFSDriver::descriptors, mfs_data_header_t::id, mfs_data_header_t::magic, MFS_CFG_MAX_RECORDS, mfs_flash_write(), mfs_garbage_collect(), MFSDriver::next_offset, osalDbgCheck, RET_ON_ERROR, mfs_data_header_t::size, MFSDriver::state, and MFSDriver::used_space.

Here is the call graph for this function:

mfs_error_t mfsPerformGarbageCollection ( MFSDriver mfsp)

Enforces a garbage collection operation.

Garbage collection involves: integrity check, optionally repairs, obsolete data removal, data compaction and a flash bank swap.

Parameters
[in]mfsppointer to the MFSDriver object
Returns
The operation status.
Return values
MFS_NO_ERRORif the operation has been successfully completed.
MFS_ERR_INV_STATEif the driver is in not in MSG_READY state.
MFS_ERR_FLASH_FAILUREif the flash memory is unusable because HW failures. Makes the driver enter the MFS_ERROR state.
MFS_ERR_INTERNALif an internal logic failure is detected.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1153 of file mfs.c.

References mfs_garbage_collect(), osalDbgCheck, and MFSDriver::state.

Here is the call graph for this function: