From 857e1f3ec61845c1634ddff1e2a325ecdd2b716f Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Fri, 13 May 2022 18:45:11 +0800 Subject: [PATCH] [Ameba] Fix 8710C OTA flash erase size (#18411) * [OTA] Fix 8710C OTA flash erase size - Refer to partition.json for size * Restyled by clang-format Co-authored-by: Restyled.io --- src/platform/Ameba/AmebaOTAImageProcessor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/Ameba/AmebaOTAImageProcessor.cpp b/src/platform/Ameba/AmebaOTAImageProcessor.cpp index ef9e51b8a6eccf..e14439eb1d4269 100644 --- a/src/platform/Ameba/AmebaOTAImageProcessor.cpp +++ b/src/platform/Ameba/AmebaOTAImageProcessor.cpp @@ -322,7 +322,8 @@ void AmebaOTAImageProcessor::HandleProcessBlock(intptr_t context) // Erase target partition ChipLogProgress(SoftwareUpdate, "Erasing partition"); - imageProcessor->NewFWBlkSize = ((0x1F8000 - 1) / 4096) + 1; // Use a fixed image length of 0xF8000, change in the future + imageProcessor->NewFWBlkSize = + ((0x1AC000 - 1) / 4096) + 1; // Use a fixed image length of 0x1AC000, change in the future ChipLogProgress(SoftwareUpdate, "Erasing %d sectors", imageProcessor->NewFWBlkSize); device_mutex_lock(RT_DEV_LOCK_FLASH); for (int i = 0; i < imageProcessor->NewFWBlkSize; i++)