![]() |
RZT Flexible Software Package Documentation
Release v2.3.0
|
|
Functions | |
fsp_err_t | RM_FREERTOS_PLUS_FAT_Open (rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_cfg_t const *const p_cfg) |
fsp_err_t | RM_FREERTOS_PLUS_FAT_MediaInit (rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_device_t *const p_device) |
fsp_err_t | RM_FREERTOS_PLUS_FAT_DiskInit (rm_freertos_plus_fat_ctrl_t *const p_ctrl, rm_freertos_plus_fat_disk_cfg_t const *const p_disk_cfg, FF_Disk_t *const p_disk) |
fsp_err_t | RM_FREERTOS_PLUS_FAT_DiskDeinit (rm_freertos_plus_fat_ctrl_t *const p_ctrl, FF_Disk_t *const p_disk) |
fsp_err_t | RM_FREERTOS_PLUS_FAT_InfoGet (rm_freertos_plus_fat_ctrl_t *const p_ctrl, FF_Disk_t *const p_disk, rm_freertos_plus_fat_info_t *const p_info) |
fsp_err_t | RM_FREERTOS_PLUS_FAT_Close (rm_freertos_plus_fat_ctrl_t *const p_ctrl) |
Middleware for the FAT File System control on RZ microprocessor.
This module provides the hardware port layer for FreeRTOS+FAT file system. After initializing this module, refer to the FreeRTOS+FAT API reference to use the file system: https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_FAT/index.html
Currently, the module supports only Block Media USB, but will support Block Media SDMMC in the future.
The FreeRTOS+FAT port module supports the following features:
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_rm_freertos_plus_fat0 | Module name. |
Total Number of Sectors | Must be a non-negative integer | 31293440 | Enter the total number of sectors on the device. If this is not known, update rm_freertos_plus_fat_device_t::sector_count after calling RM_FREERTOS_PLUS_FAT_MediaInit(). |
Sector Size (bytes) | Must be a power of 2 multiple of 512 | 512 | Select the sector size. Must match the underlying media sector size and at least 512. If this is not known, update rm_freertos_plus_fat_device_t::sector_size_bytes after calling RM_FREERTOS_PLUS_FAT_MediaInit(). |
Cache Size (bytes) | Must be a power of 2 multiple of 512 | 1024 | Select the cache size. Must be a multiple of the sector size and at least 2 times the sector size. |
Partition Number | Must be a non-negative integer | 0 | Select the partition number for this disk. |
Callback | Name must be a valid C symbol | NULL | A user callback function can be provided. If this callback function is provided, it will be called when a card is inserted or removed. |
If the underlying driver supports non-blocking operations, the FreeRTOS+FAT port pends the active FreeRTOS task during read and write operations so other tasks can run in the background.
If FreeRTOS is not used, the FreeRTOS+FAT port spins in a while loop waiting for read and write operations to complete.
When using the FreeRTOS+FAT function on the Cortex-A55 side, the default stack size of the FreeRTOS thread may be insufficient. Please increase the stack size as needed.
To use FreeRTOS+FAT without FreeRTOS, copy FreeRTOSConfigMinimal.h to one of your project's include paths and rename it FreeRTOSConfig.h.
Also, update the Malloc function to malloc and the Free function to free in the Common configurations.
Please refer to "Debug" section in FreeRTOS Port(rm_freertos_port).
This is a basic example of FreeRTOS+FAT in an application.
This shows how to partition and format a disk if it is not already partitioned and formatted.
This shows how to use the callback to wait for media insertion.
This shows how to use the callback to read and write to USB media.
When closing multiple files simultaneously, some USB devices may require a long time to flush data. As a result, the host may proceed to the next operation while the USB device is still processing.
Please add an appropriate wait time or implement a check to ensure that data has been written to the file, as shown below.
Data Structures | |
struct | rm_freertos_plus_fat_instance_ctrl_t |
struct rm_freertos_plus_fat_instance_ctrl_t |
FreeRTOS plus FAT private control block. DO NOT MODIFY. Initialization occurs when RM_FREERTOS_PLUS_FAT_Open is called.
fsp_err_t RM_FREERTOS_PLUS_FAT_Open | ( | rm_freertos_plus_fat_ctrl_t *const | p_ctrl, |
rm_freertos_plus_fat_cfg_t const *const | p_cfg | ||
) |
Initializes lower layer media device.
Implements rm_freertos_plus_fat_api_t::open().
FSP_SUCCESS | Success. |
FSP_ERR_ASSERTION | An input parameter was invalid. |
FSP_ERR_ALREADY_OPEN | Module is already open. |
FSP_ERR_OUT_OF_MEMORY | Not enough memory to create semaphore. |
fsp_err_t RM_FREERTOS_PLUS_FAT_MediaInit | ( | rm_freertos_plus_fat_ctrl_t *const | p_ctrl, |
rm_freertos_plus_fat_device_t *const | p_device | ||
) |
Initializes the media device. This function blocks until all identification and configuration commands are complete.
Implements rm_freertos_plus_fat_api_t::mediaInit().
FSP_SUCCESS | Module is initialized and ready to access the memory device. |
FSP_ERR_ASSERTION | An input parameter is invalid. |
FSP_ERR_NOT_OPEN | Module has not been initialized. |
fsp_err_t RM_FREERTOS_PLUS_FAT_DiskInit | ( | rm_freertos_plus_fat_ctrl_t *const | p_ctrl, |
rm_freertos_plus_fat_disk_cfg_t const *const | p_disk_cfg, | ||
FF_Disk_t *const | p_disk | ||
) |
Initializes a FreeRTOS+FAT disk structure. This function calls FF_CreateIOManger.
Implements rm_freertos_plus_fat_api_t::diskInit().
FSP_SUCCESS | Module is initialized and ready to access the memory device. |
FSP_ERR_ASSERTION | An input parameter is invalid. |
FSP_ERR_NOT_OPEN | Module has not been initialized. |
FSP_ERR_INTERNAL | Call to FF_CreateIOManger failed. |
fsp_err_t RM_FREERTOS_PLUS_FAT_DiskDeinit | ( | rm_freertos_plus_fat_ctrl_t *const | p_ctrl, |
FF_Disk_t *const | p_disk | ||
) |
Deinitializes a FreeRTOS+FAT disk structure. This function calls FF_DeleteIOManger.
Implements rm_freertos_plus_fat_api_t::diskDeinit().
FSP_SUCCESS | Module is initialized and ready to access the memory device. |
FSP_ERR_ASSERTION | An input parameter is invalid. |
FSP_ERR_NOT_OPEN | Module has not been initialized. |
fsp_err_t RM_FREERTOS_PLUS_FAT_InfoGet | ( | rm_freertos_plus_fat_ctrl_t *const | p_ctrl, |
FF_Disk_t *const | p_disk, | ||
rm_freertos_plus_fat_info_t *const | p_info | ||
) |
Get partition information. This function can only be called after rm_freertos_plus_fat_api_t::diskInit().
Implements rm_freertos_plus_fat_api_t::infoGet().
FSP_SUCCESS | Information stored in p_info. |
FSP_ERR_ASSERTION | An input parameter was invalid. |
FSP_ERR_NOT_OPEN | Module not open. |
FSP_ERR_NOT_FOUND | The value of p_iomanager is NULL. |
fsp_err_t RM_FREERTOS_PLUS_FAT_Close | ( | rm_freertos_plus_fat_ctrl_t *const | p_ctrl | ) |
Closes media device.
Implements rm_freertos_plus_fat_api_t::close().
FSP_SUCCESS | Media device closed. |
FSP_ERR_ASSERTION | An input parameter was invalid. |
FSP_ERR_NOT_OPEN | Module not open. |