diff --git a/driver/src/hw3/board_info_hw.c b/driver/src/hw3/board_info_hw.c index 8fb13cc..fcd31c2 100644 --- a/driver/src/hw3/board_info_hw.c +++ b/driver/src/hw3/board_info_hw.c @@ -390,6 +390,7 @@ void board_oem_signal_mtx_binding(iot_board_info_v1_t *rc_info) +extern int32_t sbl_printf(const char *fmt, ...); uint32_t board_load_oem_cfg() @@ -418,13 +419,13 @@ uint32_t board_load_oem_cfg() g_board_cpu_idx = cpu_get_mhartid(); #endif - iot_printf("start load oemcfg\n"); - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("start load oemcfg\n"); + sbl_printf("%s:%d\n",__FILE__,__LINE__); ret = iot_oem_get_cfg(&oemcfg); if (ret != ERR_OK) { goto out; } - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("%s:%d\n",__FILE__,__LINE__); g_board_info.board_id = oemcfg->board_id; IOT_ASSERT(oemcfg->board_cfg_ver == IOT_OEM_VER_V1); @@ -440,21 +441,22 @@ uint32_t board_load_oem_cfg() goto out; } // 读取oem的差分部分 - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("%s:%d\n",__FILE__,__LINE__); ret = iot_oem_read_mtd(buf_oem, oem_part_size - oem_diff_offset, oem_diff_offset); if (ret != ERR_OK) { goto out; } - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("%s:%d\n",__FILE__,__LINE__); ret = ERR_FAIL; hw_ver_cal = iot_board_hw_version_hex(); /* if hw_version is not written during production test, it defaults to f */ if (hw_ver_cal == 0xffffffff) { - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("%s:%d\n",__FILE__,__LINE__); hw_ver_cal = 0; } + sbl_printf("board_hw_ver=%08x\n",hw_ver_cal); // ptr_rc 是 iot_board_info_v1_t 类型的指针 ptr_hdr = &ptr_rc->hdr; hw_ver_rc = ptr_hdr->hw_version; @@ -465,6 +467,7 @@ hdr_check: if (ptr_hdr->have_next == 0) { if(read_oem_ext_flag || iot_oem_read_mtd_ext(&buf_oem[offset],BOARD_OEM_INFO_SIZE_MAX-offset)){ + sbl_printf("%s:%d\n",__FILE__,__LINE__); goto out; } else { ptr_hdr->have_next = 1; @@ -480,6 +483,7 @@ hdr_check: hw_ver_rc = ptr_hdr->hw_version; goto hdr_check; } + sbl_printf("count_rc=%d\n",cnt_rc); /* prevent array out of bounds */ // 最多只支持63个硬件识别码 diff --git a/pib/src/iot_oem.c b/pib/src/iot_oem.c index f4a5a64..7c61754 100644 --- a/pib/src/iot_oem.c +++ b/pib/src/iot_oem.c @@ -109,6 +109,17 @@ uint32_t iot_oem_read_mtd(uint8_t *buf, uint32_t size, uint32_t offset) } +extern int32_t sbl_printf(const char *fmt, ...); + + +static void data_printf(const uint8_t *data,int len){ + for (int i=0;iv1.imgSize; + sbl_printf("%s:%d\n",__FILE__,__LINE__); + img_header_construct(&run_fw_hdr,(char *)(hdr.v1.runAddr-HEADER_TOLTAL_SIZE)); + data_printf((const uint8_t *)&run_fw_hdr,32); + fw_size=run_fw_hdr.v1.imgSize; + sbl_printf("fw_size:%ld\n",fw_size); data=(const uint8_t *)(hdr.v1.runAddr+fw_size-oem_ext_magic_str_len); - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("oem_ext_magic_str_addr:%p\n",data); + sbl_printf("%s:%d\n",__FILE__,__LINE__); os_mem_cpy(str_buff,data,oem_ext_magic_str_len); - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("str_buff:%s\n",str_buff); + sbl_printf("%s:%d\n",__FILE__,__LINE__); if(iot_strcmp(str_buff,oem_ext_magic_str) != 0){ break; } - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("%s:%d\n",__FILE__,__LINE__); data-=4; oem_size=((data[0]<<24)|(data[1]<<16)|(data[2]<<8)|data[3]); + sbl_printf("oem_size:%ld\n",oem_size); data=data-oem_size; - iot_printf("%s:%d\n"__FILE__,__LINE__); + sbl_printf("%s:%d\n",__FILE__,__LINE__); if(buff_size