Skip to content

Commit

Permalink
[Ameba] Fix 8710C OTA flash erase size (#18411)
Browse files Browse the repository at this point in the history
* [OTA] Fix 8710C OTA flash erase size
- Refer to partition.json for size

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 5, 2024
1 parent fdfc540 commit 3588682
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/platform/Ameba/AmebaOTAImageProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit 3588682

Please sign in to comment.