![]() |
WE310F5
39.00.000
|
This section describes the M2MB API for the flash module. More...
#define | M2MB_FLASH_PARTITION_ALL 0x7FFF |
typedef struct M2MB_FLASH_INFO | M2MB_FLASH_INFO_T |
INT32 | m2mb_flash_open (UINT32 partition_id, HANDLE *handle) |
m2mb_flash_open opens handle to a flash partition. More... | |
INT32 | m2mb_flash_close (HANDLE handle) |
m2mb_flash_close Closes handle to a flash partition. More... | |
INT32 | m2mb_flash_get_info (HANDLE handle, M2MB_FLASH_INFO_T *flash_info) |
m2mb_flash_get_info Gets flash device information. More... | |
INT32 | m2mb_flash_erase (HANDLE handle, UINT32 start_block, UINT32 block_count) |
m2mb_flash_erase erases given flash blocks. More... | |
INT32 | m2mb_flash_write (HANDLE handle, UINT32 byte_offset, UINT32 byte_count, void *buffer) |
m2mb_flash_write writes to the flash. More... | |
INT32 | m2mb_flash_read (HANDLE handle, UINT32 byte_offset, UINT32 byte_count, void *buffer) |
m2mb_flash_read to read the flash. More... | |
INT32 | m2mb_flash_erase_bulk (HANDLE handle, UINT32 start_block, UINT32 block_count) |
m2mb_flash_erase_bulk Erases given flash blocks of specified block size. More... | |
This section describes the M2MB API for the flash module.
Flash access module provides APIs to open the flash module and read/ write raw data to it. Since flash stores the code and file system, so be careful while writing to the flash. Ensure that flash write does not happen on these areas. The only recovery way is to re-flash the board with the new image using the boot loader.
#define M2MB_FLASH_PARTITION_ALL 0x7FFF |
Definition at line 50 of file m2mb_flash.h.
typedef struct M2MB_FLASH_INFO M2MB_FLASH_INFO_T |
m2mb_flash_close Closes handle to a flash partition.
Clients should close the flash partition when accesses to the partition is no longer needed.
[in] | handle | Pointer to FLASH interface handle to store |
m2mb_flash_erase erases given flash blocks.
Erases given flash blocks.
[in] | handle | Pointer to FLASH interface handle to store. |
[in] | start_block | Starting block from where the erase has to happen. |
[in] | block_count | Number of block to erase. |
m2mb_flash_erase_bulk Erases given flash blocks of specified block size.
Erases given flash blocks.
[in] | handle | Pointer to FLASH interface handle to store. |
[in] | start_block | Starting block from where the erase has to happen. |
[in] | block_count | Number of blocks to erase. |
INT32 m2mb_flash_get_info | ( | HANDLE | handle, |
M2MB_FLASH_INFO_T * | flash_info | ||
) |
m2mb_flash_get_info Gets flash device information.
Gets flash device information with the data related to manufacturer ID, flash size, sector size and number of sector.
[in] | handle | Pointer to FLASH interface handle to store. |
[in] | flash_info | Pointer to the client's flash device info data. |
m2mb_flash_open opens handle to a flash partition.
m2mb_flash_open opens the given partition.
[out] | partition_id | Partition ID. |
[out] | handle | Pointer to FLASH interface handle to store |
m2mb_flash_read to read the flash.
Reads from flash.
[in] | handle | Pointer to FLASH interface handle to store. |
[in] | byte_offset | Byte offset from the start of the partition/image to read from. |
[in] | byte_count | Number of bytes to read data. |
[out] | buffer | Data buffer to store the data read from flash. |
m2mb_flash_write writes to the flash.
Writes to the flash.
[in] | handle | Pointer to FLASH interface handle to store. |
[in] | byte_offset | Byte offset from the start of the partition/image to write to. |
[in] | byte_count | Number of bytes to write data. |
[in] | buffer | Data buffer for flash write operation. |