这是最新(主)开发分支的文档。如果您正在查找以前版本的文档,使用左侧的下拉菜单选择所需的版本。

Partition table API

数据结构体

struct wm_partition_item_t

partition infomation

Public Members

char name[16]

partition name

uint32_t offset

partition offset

uint32_t size

partition size

uint32_t flag

partition flag

相关API

int wm_partition_table_init(void)

initialize partition table module

备注

Partition table must exist in flash, and it must be burned to CONFIG_WM_PARTITION_TABLE_OFFSET

返回:

  • WM_ERR_SUCCESS: success

  • WM_ERR_NOT_FOUND: fail

int wm_partition_table_find(const char *name, wm_partition_item_t *partition)

find a partition information by partition name

备注

must called after wm_partition_table_init

参数:
返回:

  • WM_ERR_SUCCESS: success

  • WM_ERR_INVALID_PARAM: invalid argument

  • WM_ERR_NOT_FOUND: Not found the partition

void wm_partition_table_print(void)

print partition table information

返回:

  • WM_ERR_SUCCESS: success

  • WM_ERR_NOT_FOUND: fail