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

feat(blri): add serial flashing support and refactor CLI structure #27

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

jakezhu9
Copy link
Member

In this pull request, I've refactored the command-line interface of the blri tool and added a new flash command. This allows users to directly flash images to the development board via serial port, making the flashing process simpler and more convenient.

Taking bouffalo-hal/bouffalo-rt/examples/blinky-bl808 as an example, from compilation to flashing, you only need to run the following commands:

# Compile
cargo build -p blinky-bl808 --features bl808-dsp --target riscv64imac-unknown-none-elf --release

# Extract the binary image
rust-objcopy --binary-architecture=riscv64 --strip-all -O binary ./target/riscv64imac-unknown-none-elf/release/blinky-bl808 ./target/riscv64imac-unknown-none-elf/release/blinky-bl808.bin

# Fix the image header (CRC and other fields)
cargo blri patch ./target/riscv64imac-unknown-none-elf/release/blinky-bl808.bin

# Flash to the development board
cargo blri flash ./target/riscv64imac-unknown-none-elf/release/blinky-bl808.bin

Screenshot:

@jakezhu9 jakezhu9 requested a review from luojia65 February 22, 2025 05:36
Copy link
Member

@luojia65 luojia65 left a comment

Choose a reason for hiding this comment

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

LGTM

@luojia65 luojia65 merged commit f2ab0d7 into rustsbi:main Feb 22, 2025
15 checks 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