Skip to content

Allow disabling CRC checking for maskrom writes - #68

Merged
sjoerdsimons merged 2 commits into
mainfrom
upload-without-crc
Sep 9, 2026
Merged

Allow disabling CRC checking for maskrom writes#68
sjoerdsimons merged 2 commits into
mainfrom
upload-without-crc

Conversation

@sjoerdsimons

Copy link
Copy Markdown
Collaborator

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-crc flags 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.

Comment thread rockusb/src/device.rs Outdated
Comment thread rockusb/tests/maskrom.rs Outdated
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
sjoerdsimons added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 51542ab Sep 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Option to disable CRC during download-ddr

2 participants