Allow disabling CRC checking for maskrom writes - #68
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an option to skip CRC-16 calculation/verification for MaskRom area writes, enabling faster large uploads on chips that support “zero-CRC” behavior (per #66).
Changes:
- Extend the MaskRom write operation to optionally omit CRC calculation and instead append
0x0000. - Add a device API (
write_maskrom_area_no_crc) and expose it via--no-crcflags in the example CLI commands. - Add a unit test covering the zero-CRC write behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rockusb/src/operation.rs | Allow MaskRom write steps to run with CRC enabled/disabled and append 0x0000 when disabled. |
| rockusb/src/device.rs | Add public device method for MaskRom writes that skip CRC. |
| rockusb/examples/common.rs | Add --no-crc option to maskrom download commands and thread the flag through download helpers. |
| rockusb/tests/maskrom.rs | Add test asserting the CRC bytes are zeroed when using the new no-CRC API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
CRC checking on maskrom writes can be really slow. Some Rockchip devices allow skipping the CRC check if 0's, speeding up the process especially for bigger payloads.
Allow disabling CRC checks on all maskrom download operations (download-boot, download-sram and download-ddr). This can provide a speedup when download larger data sizes (especially for ddr), it is however not supported by all devices
sjoerdsimons
force-pushed
the
upload-without-crc
branch
from
August 12, 2026 18:53
6c453fa to
b775a7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maskrom writes have a CRC-16 at the end. The ROM checks this after finishing the write operation, however this can be really slow. Some chips support skipping the check if the CRC is at the end, which can greatly speedup the operation especially when doing a big DDR upload.
Thusfar test show this works on RK3576 (for both sram and DDR), while it's unsupported by RK3308.
Fixes: #66