修改 ah fw 在fw img 之后读取附加的oem数据

This commit is contained in:
2024-10-26 14:10:20 +08:00
parent 1a60d3f171
commit d5325ac3aa
6 changed files with 93 additions and 17 deletions

View File

@@ -48,6 +48,11 @@ extern "C" {
#define IOT_OEM_SECTION_SEC_ADDR (3072)
#define IOT_OEM_EXT_SECTION_OFFSET(fw_size) \
(((fw_size+31)&(~0x1f))+IOT_OEM_SECTION_START_ADDR)
#define IOT_OEM_EXT_MAGIC_STR "_oem_ext"
#define IOT_OEM_DUMMY_LEN 106
/* use simple pair passcode for security check */
#define IOT_OEM_SEC_TYPE_PASSCODE 1
@@ -219,6 +224,14 @@ extern const uint8_t g_iot_sec_root_sm2_pub_v1[IOT_SEC_ROOT_SM2_PUB_LEN];
*/
uint32_t iot_oem_read_mtd(uint8_t *buf, uint32_t size, uint32_t offset);
/**
* @brief iot_oem_read_mtd_ext() - read oem ext data from flash fw section.
* @param buf: pointer to receive oem data.
* @param size: length to receive oem data.
* @retval 0 success; others fail.
*/
uint32_t iot_oem_read_mtd_ext(uint8_t *buf, uint32_t size);
/**
* @brief iot_oem_init - init oem function.
* warning, iot_oem_init should be called after pib load