The image src/ferris.raw is from this project.
rustup target install riscv64imac-unknown-none-elf
cargo build --target riscv64imac-unknown-none-elf --release -p spi-demoObjcopy and prepare flash image with:
cargo install cargo-binutils
rustup component add llvm-tools-preview
rust-objcopy --binary-architecture=riscv64 --strip-all -O binary ./target/riscv64imac-unknown-none-elf/release/spi-demo ./target/riscv64imac-unknown-none-elf/release/spi-demo.bin
cargo blri ./target/riscv64imac-unknown-none-elf/release/spi-demo.binFlash the binary file to the board with Bouffalo Lab Dev Cube on Windows:
-
Connect the board to the computer via UART (Here takes M1s Dock as an example):
- Normally, you can see 2 new serial ports. If not, visit Burn onboard bl702 for help.
-
Run the
BLDevCube.exe, chooseBL808, and clickFinish. -
In MCU page, browse
target\riscv64imac-unknown-none-elf\release\spi-demo.binas the target ofD0 Group. Choose the bigger number serial port, and set uart rate 2000000. -
Press BOOT and RST on the board, then release RST first and BOOT after to be into UART burning mode.
-
Click
Create & Download, wait for flash the binary file to success. -
After flashing, repower the board and you will see the
ferrisimage on the screen.
Replace PORT_NAME with your com name, COMx for Windows, /dev/ttyx for Linux.
cargo run --target riscv64imac-unknown-none-elf --release -p spi-demo -- --port PORT_NAME