Browse Source

更新CPU工程
1. 修复升级进度条进度值参数计算异常的问题(升级文件超过40M导致计算值越界,进度参数值异常)。
2. 修复OTA升级MCU固件时的升级文件大小判断条件异常使用问题。

helen 1 month ago
parent
commit
2905ec4e8d

+ 2 - 3
amt630hv160-freertos-beta/ArkmicroFiles/libboard-amt630hv160/source/ota_update.c

@@ -366,7 +366,6 @@ static int MediaUpdateMCU(const char *ufile, int filetype)
 	uint32_t filesize;
 	MailboxUpdateFrame tx_frame = {0};
 	MailboxUpdateFrame *rx_frame = NULL;
-	uint32_t ddr_crc = 0, flash_crc = 0;
 	mb_rxmsg_t msg = {0};
 
 	fp = ff_fopen(ufile, "rb");
@@ -376,7 +375,7 @@ static int MediaUpdateMCU(const char *ufile, int filetype)
 	}
 
 	leftsize = filesize = ff_filelength(fp);
-	if (filesize > DDR_MEDIA_USE_ADDR) {
+	if (filesize > DDR_MEDIA_USE_SIZE) {
 		printf("The file is too large, not enough space to save.\n");
 		goto MediaUpdateEnd;
 	}
@@ -667,7 +666,7 @@ static int burn_update_file(int filetype, const char *ufile, size_t fileoffset,
 #ifdef UPDATE_PROGRESS_SUPPORT
 		if (show_progress) {
 			upfile_left_size -= rwsize;
-			update_progress_set((upfile_total_size - upfile_left_size) * 100 / upfile_total_size);
+			update_progress_set(((u64)upfile_total_size - upfile_left_size) * 100 / upfile_total_size);
 		}
 #endif
 		if (!show_progress) {