Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xtask command to generate and verify flash image #31

Merged
merged 9 commits into from
Nov 25, 2024

Conversation

mlvisaya
Copy link
Collaborator

Following the flash layout defined in
https://github.com/chipsalliance/caliptra-mcu-sw/blob/main/docs/src/flash_layout.md

  • Add new command to specify the firmware files and soc manifest to create 1 flash image file that can be burned to the SPI flash.

  • Add new command to verify a flash image file

Example:

cargo run --bin flash-image create --caliptra-fw caliptra_fw.bin
--soc-manifest soc_manifest.bin
--mcu-runtime mcu_runtime.bin
--soc-images soc_image1.bin soc_image2.bin soc_image3.bin
--output flash_image.bin

cargo run --bin flash-image verify flash_image.bin

Following the flash layout defined in
https://github.com/chipsalliance/caliptra-mcu-sw/blob/main/docs/src/flash_layout.md

- Add new command to specify the firmware files and soc manifest to
create 1 flash image file that can be burned to the SPI flash.

- Add new command to verify a flash image file

Example:

cargo run --bin flash-image create --caliptra-fw caliptra_fw.bin \
             --soc-manifest soc_manifest.bin \
             --mcu-runtime mcu_runtime.bin \
             --soc-images soc_image1.bin soc_image2.bin soc_image3.bin \
             --output flash_image.bin

cargo run --bin flash-image verify flash_image.bin
Marco Visaya added 2 commits November 21, 2024 14:28
Tests can run simultaneously and can access the same temporary files at
the same time.
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
mlvisaya and others added 5 commits November 22, 2024 10:55
Co-authored-by: Christopher Swenson <[email protected]>
- use zerocopy
- convert all Vecs in structs to slices
- various code optimization
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
xtask/src/flash_image.rs Show resolved Hide resolved
xtask/src/flash_image.rs Outdated Show resolved Hide resolved
- use zerocopy to parse image buffer
- add packed trait to structs
- use String instead of &str in CLI args
Copy link
Collaborator

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM

@mlvisaya mlvisaya merged commit 1121b38 into main Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants